nistvan86 / wv4dart Goto Github PK
View Code? Open in Web Editor NEWwv4dart
wv4dart
Hi,
I'd like to have a closer look at your code to see if there are any suggestions I can make, either fixing bugs or improving performance. However there are a few things that need to be looked at first in the code so I thought I'd pass them on (before I look at the actual WavPack processing code as such). I tried your code with the current version of dart.
In dartutils.dart, .asByteArray() does not seem to be supported anymore, so I used the following equivalent (change as appropriate in the 3 places)
return (new ByteData.view(resultList.buffer)).getInt32(0,Endianness.LITTLE_ENDIAN);
This seemed to work well enough to at least get past that part of the code.
In main.dart I changed the following line for your read() method in your RandomAccessWavPackFile class - I changed
return _file.readListSync(buffer, offset, length);
to
return _file.readIntoSync(buffer, offset, offset+length);
In main.dart I was also getting an error about RandomFile so I made 2 changes, when opening I used:
File outputf = new File("output.wav");
RandomAccessFile output = outputf.openSync(mode: FileMode.WRITE);
and then actually writing the data its now
output.writeFromSync(pcm_buffer,0, samples_unpacked * bps);
However, while this actually allowed the code to run and start producing output, it gave an out of memory error, so definitely something needs to be change around here.
With these changes I was able to successfully decode a very small test file, however larger files were giving the out of memory error so I wasn't able to start looking at your actual WavPack routines.
Peter
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.