Perfare / AssetStudio

AssetStudio is a tool for exploring, extracting and exporting assets and assetbundles.
MIT License
13.44k stars 2.58k forks source link

Suggestion: Option to extract Vorbis FSB audio as OGG Vorbis. #940

Open Nazosan opened 2 years ago

Nazosan commented 2 years ago

Currently with Unity Asset Studio, when extracting audio you have to either convert it to a WAV file or extract it raw. Because the audio is already stored in a lossy compression encoding, if you extract to a WAV and then convert to OGG Vorbis or MP3 or etc, significantly further quality will be lost. Alternately, if you extract it raw it's extremely hard to actually do anything with it. I haven't even really been able to entirely figure out how to do it myself (I'm no dev, but at least I generally know what I'm doing with audio files) but it seems like in particular a new header must be generated for the file or something after the actual audio is extracted from the FSB. I couldn't find any tools to help with this and it's beyond me to actually manually write a header to a file myself even after quite a bit of googling.

Rather than lossy conversions, isn't it at least presumably possible to extract the original audio and add a proper package and header as needed so normal software can understand them, thus keeping the original in its original quality? If the original audio is encoded in a well understood encoding such as Vorbis it seems completely unnecessary to have to lose the original data (after all, we're not talking about something painful like ATRAC3+ -- thank goodness.) If one wishes to do modifications or etc, it's simple enough to convert something like an OGG Vorbis to an uncompressed WAV or whatever after the fact anyway (in fact, most modern audio editors will simply import such a file directly and apply changes separately, saving the need for a manual intermediary.) This can especially help enormously with disk space usage since even lossless formats like FLAC and Monkey's Audio are quite significantly larger than an OGG Vorbis.

09williamsad commented 2 years ago

Use Foobar with the VGMStream plugin to read the raw audio files and convert to ogg.

Nazosan commented 2 years ago

I think there may be a little confusion about how that process works. With Foobar2000, plugins basically send uncompressed audio through its engine. If you convert to OGG then you're not simply tacking on a header as the original post specifies, but actually recompressing that audio. In other words, you'd still be recompressing lossy to lossy, just with a different process in the middle.