Giter Club home page Giter Club logo

riff's People

Contributors

mattetti avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

stevenh

riff's Issues

Wrong duration from wavDuration()

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.

chunk.Size includes padding

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.