C
C#17mo 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
Pobiega17mo ago
give this one a try? https://github.com/VPKSoft/NAudio.Flac its a format plugin for NAudio
Omar
OmarOP17mo ago
What's NAudio? I was hoping for something that had documentation.
SinFluxx
SinFluxx17mo 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
OmarOP17mo 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
Pobiega17mo ago
well, you dont need a port or wrapper you can just extern calls directly into libflac, if you're familiar with it
Omar
OmarOP17mo ago
I suppose, but I'd prefer a pre-made solution (to save work, obviously)
Pobiega
Pobiega17mo ago
https://github.com/WilliamWsyHK/FlaCdotNet seems to be pretty much that?
Omar
OmarOP17mo ago
Unmaintained, no docs ... but it might be close. Maybe it's better to write this project in C++ directly.
Pobiega
Pobiega17mo 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
OmarOP17mo 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
Pobiega17mo 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
OmarOP17mo ago
I think thats a fallacy.
Pobiega
Pobiega17mo ago
To each their own
Omar
OmarOP17mo 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
Accord16mo 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.
Want results from more Discord servers?
Add your server