-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FL Studio .wav's cannot be read #170
Comments
Would a PR be accepted which fixes this? |
Was a bit hard finding information about this, but it looks like it's a WAV file with Vorbis encoded audio.
No reason why it couldn't be supported, but If this is something you want to work on, I'll accept a PR for adding this support. Thanks! |
Interesting. Symphonia currently supports 7 types of .wav formats Symphonia/symphonia-format-wav/src/chunks.rs Lines 581 to 589 in fcca325
But the mentioned mmreg.h file has 265 formats. Would Symphonia ideally eventually support them all? |
I'm currently trying to work on this. Question: how to get a MediaSourceStream from a ReadBytes in order to plug it in to OggReader::try_new? (Is there a better place for questions like this, like a support channel?) |
Probably not, most are not used anymore or are proprietary codecs with no available specifications. The most likely contenders for inclusion would be the ADPCM codecs since they tend be used in games. I'll likely be leaving these up to contributors though since I don't have any of these files.
This wouldn't be correct way to go about this. OGG and WAVE are both distinct container formats so it is not possible to parse a WAVE file as an OGG file. If you look at the Vorbis specification, it specifies how Vorbis encoded audio data should be packaged in an OGG stream, but there's no specification for how it's packaged in a WAVE file. This Vorbis-in-WAVE format is non-standard. Therefore, some reverse engineering or educated guesses would need to be made on how it's packaged. I looked at the hex dump of the file and to me it looks like the WAVE DATA chunk contains a single logical OGG stream packaged as per the specification linked above. I imagine there are some limitations placed on the OGG pages and packets to make decoding easier, but hard to know without a large corpus of files or a specification. You can lift some code from
Discussions are enabled on this repo., but an issue seems like the right place for this one. |
When I use a hex editor to remove the bytes up to Should I still just copy paste all the OGG container code? That seems suboptimal at best One thing I'm still confused about is the bytes inbetween the WAV signature and the OGG file. |
Those bytes are part of the WAVE file format. A WAVE is split up into a tree of chunks. There are many different chunks, some of which are ignored entirely for our use-case, but others contain information about the codec, duration, metadata, and audio data. The DATA chunk contains the audio data. In this case, it contains the Vorbis audio data, packetized in OGG packets. Tricky thing is, there can be a chunk after the audio data chunk which means it's not possible to consider the remainder of the file as an OGG file. This also means that simply calling into The OGG bitstream format is actually pretty simple which is why I suggested some code duplication. It only gets bad if you can stuff complex OGG streams into a WAVE file. It'd be a bit surprising if you could considering WAVE doesn't have the concept of tracks, but without a spec. it's hard to know for sure. Unfortunately, this is rapidly becoming a very complex and convoluted problem. Given the niche use-case, I'm feeling that this moment may not be the best time for the project to implement this. I'm too short on bandwidth to give this issue the attention and support it needs. :( The best way forward would likely be for you to implement your own |
Trying to read music production software FL Studio's built-in sample file "FPC 1 Kick.wav" throws an
Unsupported("wav: unsupported wave format")
errorSample file (rename .png to .wav):
Audacity can read this file already
The text was updated successfully, but these errors were encountered: