C
C#12mo ago
Omar

❔ Package to decode FLAC files?

Can anyone recommend a C# package to decode FLAC files? I want to be able to read the FLAC file from disk, and have the decompressed waveform data in memory to process directly.
15 Replies
Pobiega
Pobiega12mo ago
give this one a try? https://github.com/VPKSoft/NAudio.Flac its a format plugin for NAudio
Omar
Omar12mo ago
What's NAudio? I was hoping for something that had documentation.
SinFluxx
SinFluxx12mo ago
NAudio itself has documentation: https://github.com/naudio/NAudio
GitHub
GitHub - naudio/NAudio: Audio and MIDI library for .NET
Audio and MIDI library for .NET. Contribute to naudio/NAudio development by creating an account on GitHub.
Omar
Omar12mo ago
Thanks. All I see is a readme, no docs. Am I missing a link? There's a bit of a Wiki, but it hasn't been updated in about 8 years. I guess the approach you're trying to suggest is to use NAudio, then this NAudio.flac plugin, to read a FLAC and convert it to WAV in memory, then go after the waveform bits in the WAV format? What I was hoping for was a C# wrapper (or port) of LIB FLAC: https://xiph.org/flac/api/group__flacpp.html
Pobiega
Pobiega12mo ago
well, you dont need a port or wrapper you can just extern calls directly into libflac, if you're familiar with it
Omar
Omar12mo ago
I suppose, but I'd prefer a pre-made solution (to save work, obviously)
Pobiega
Pobiega12mo ago
https://github.com/WilliamWsyHK/FlaCdotNet seems to be pretty much that?
Omar
Omar12mo ago
Unmaintained, no docs ... but it might be close. Maybe it's better to write this project in C++ directly.
Pobiega
Pobiega12mo ago
perhaps. There doesnt seem to be a lot of interest in a flac wrapper for C# I found two, but one was only for metadata and the other is what I linked you they are both unmaintained and no docs
Omar
Omar12mo ago
I'm af raid the "my code is self documenting!!1!" belief has made pickings slim. Indeed, it's hard to search because I trip over conversion tools (not libraries) and metadata-only solutions.
Pobiega
Pobiega12mo ago
to be fair, code should be self-documenting... but that only applies to application code, not library code library code should have /// comments for everything
Omar
Omar12mo ago
I think thats a fallacy.
Pobiega
Pobiega12mo ago
To each their own
Omar
Omar12mo ago
FlacDotNet is in pretty bad shape -- no docs, unclear ReadMe, and looks like it targets an ancient (And now incompabile) version of LibFLAC. I think I'll end up doing this in C++. Thanks, anyhow! I ended up hacking up that NAudio.Flac plugin to get the raw bits. It wasn't WAV format, just the bits -- but that ended up being fine for me.
Accord
Accord12mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.