go-audio / riff Goto Github PK
View Code? Open in Web Editor NEWResource Interchange File Format parser
License: Apache License 2.0
Resource Interchange File Format parser
License: Apache License 2.0
When calculating the duration with the wavDuration() method, the size used is Parser.Size
. In Parser.Parse()
this is set to be the RIFF
chunkSize, i.e. the file size - 8 bytes. This means that the header chunks are included in the calculation, giving a duration that is too long. The size that should be used is the size from the data
chunk.
In most cases the added duration will be small enough that you won't notice, but if you need to know the exact number of samples in the file, or you have a file with large amounts of meta data in the headers (which you could typically get with BWF and derivatives), it becomes a problem.
When fixing the parsing in wav for DecodeListChunk I tripped over the fact that Chunk.Size doesn't represent the head value as described:
Chunk represents the header and containt of a sub block
Instead it also includes the padding byte, which makes parsing more complex as you need to check for a remaining byte and ignore it instead of being able to simply rely on io.EOF.
I would instead suggest that the extra byte is handled by Chunk.Drain.
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.