Git Product home page Git Product logo

Comments (3)

ruuda avatar ruuda commented on August 23, 2024

Can you elaborate on what you mean by “getting decoded samples back”? You can alseady use FrameReader to get the decoded samples.

from claxon.

antifuchs avatar antifuchs commented on August 23, 2024

Err, yeah, sorry, I should have phrased that better. My goal is to read just plain FLAC frames as data-as-stored-on-disk (without decoding/decompressing into samples). I guess I should have written "undecoded", there.

Anyway, it looks like symphonia's FlacReader::next_packet does something like this already - they are more generic than I need, but the split between "reader that returns undecoded data" and "decoder that turns this data into usable audio" looks like a great mix for my use case (and a decent design overall, it seem!)

from claxon.

ruuda avatar ruuda commented on August 23, 2024

My goal is to read just plain FLAC frames as data-as-stored-on-disk (without decoding/decompressing into samples).

Ah, I see. I think that would be useful, but it would also be difficult to fit into Claxon’s current design.

the split between "reader that returns undecoded data" and "decoder that turns this data into usable audio" looks like a great mix for my use case (and a decent design overall, it seem!)

I am a bit unsatisfied with the way Claxon handles metadata at the moment, and I think this is a similar issue. There is a tension between providing an easy-to-use high-level interface, enabling streaming (avoiding heap allocations), and avoiding parsing (or even reading) of data that you are not interested in. (E.g. if you don’t plan to access the Vorbis comments, we can jump over the entire metadata block without parsing it, and even seek on the underlying reader if supported.) Hound has a similar issue where there are lots of low-level details that some use cases need to access, but it is difficult to unite that with a simple way to just get or write the audio data.

My thinking right now is that the best way to handle this tension is to provide two levels: low-level “building blocks” that can parse or decode (or also write, in the case of Hound) individual pieces, but which may require some boilerplate and understanding of the format to use correctly, and then on top of that a more convenient API that is maybe not the most efficient but that will do the job with little code in 80% of the cases.

Splitting the decoding of the audio data from the frame headers sounds like it would fit that model well too.

from claxon.

Related Issues (20)

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.