Comments (3)
Can you elaborate on what you mean by “getting decoded samples back”? You can alseady use FrameReader
to get the decoded samples.
from claxon.
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.
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)
- version of hound required by claxon does not compile HOT 3
- Contents of uninitialized memory are leaked into the output on malformed inputs HOT 9
- [wishlist] Drop the unsafe ensure_buffer_len() HOT 4
- Some FLAC files don't decode because LPC order > 12 is not supported HOT 6
- Support reading flac tag HOT 2
- Emtpy Vorbis Comment HOT 7
- How to use in async code HOT 2
- Consider adding encoding support HOT 1
- Reading on uninitialized memory may cause UB HOT 6
- MSRV for this crate? HOT 2
- A blueprint for seeking feature HOT 6
- Frame with block size shorter than 16 samples HOT 2
- Last call on FLAC specification HOT 2
- `read_next_or_eof`'s API prevents buffer reuse HOT 1
- Frame CRC mismatch HOT 2
- Support alternative containers HOT 5
- Issues with privacy HOT 7
- About the metadata issue HOT 2
- FLAC file reading performance HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from claxon.