Compressing flac to ogg (scummvm talkies)

Ask for help with ScummVM problems

Moderator: ScummVM Team

Jellby
Posts: 26
Joined: Fri Apr 27, 2007 8:20 pm

Compressing flac to ogg (scummvm talkies)

Post by Jellby »

Hi all,

Is there some way to compress directly flac (.sof) to ogg (.sog) voice files? This would be interesting in particular for the Monkey Island talkie patch (using voices from the Special Edition), where the flac file has apparently better quality than the uncompressed .sou. I'd like to keep a backup of the flac, and build the ogg or mp3 files from there, and not from the full game install (which requires Windows).
User avatar
LogicDeLuxe
Posts: 431
Joined: Thu Nov 10, 2005 9:54 pm

Re: Compressing flac to ogg (scummvm talkies)

Post by LogicDeLuxe »

Jellby wrote:This would be interesting in particular for the Monkey Island talkie patch
No, it wouldn't, since it supports building the Ogg Vorbis version the same way it builds the FLAC version already. If you managed to build one version, you should manage to build the others too.
Jellby
Posts: 26
Joined: Fri Apr 27, 2007 8:20 pm

Re: Compressing flac to ogg (scummvm talkies)

Post by Jellby »

LogicDeLuxe wrote:
Jellby wrote:This would be interesting in particular for the Monkey Island talkie patch
No, it wouldn't, since it supports building the Ogg Vorbis version the same way it builds the FLAC version already. If you managed to build one version, you should manage to build the others too.
Yes, but as I said that requires a Windows machine, and I'd like to keep a single "master" file from which I could build the other versions when needed (without Windows). I could, of course, build all versions and store them all, but that's redundant, and still, I wouldn't be able to rebuild them with different settings (i.e., I'd have to go back to Windows for that).
Bloodbat
Posts: 30
Joined: Mon May 17, 2010 4:30 pm

Re: Compressing flac to ogg (scummvm talkies)

Post by Bloodbat »

Jellby wrote: where the flac file has apparently better quality than the uncompressed .sou.
I wonder how that works...do bytes magically appear to improve the sound quality?
FLAC is a lossless compressor, true, but...other than, maybe, using psycho-acousting modelling...there's no way in Hell (or Earth) a compressed file can improve upon the original (the data isn't there to begin with).
Jellby
Posts: 26
Joined: Fri Apr 27, 2007 8:20 pm

Re: Compressing flac to ogg (scummvm talkies)

Post by Jellby »

Bloodbat wrote:I wonder how that works...do bytes magically appear to improve the sound quality?
FLAC is a lossless compressor, true, but...other than, maybe, using psycho-acousting modelling...there's no way in Hell (or Earth) a compressed file can improve upon the original (the data isn't there to begin with).
That's probably bad wording on my part. Both flac and sou are obtained from whatever is stored in the original files (let's assume it's wav). Flac is compressed for that, but without reduced quality, sou, while maybe not exactly "compressed", has reduced quality, with frequency reduced to 22050 Hz or something like that.

At least that's my interpretation. What I do know is that the flac file is about twice the size of the sou. If I'm wrong and the sou quality is exactly like flac, then just forget about this :)
tobybear
Posts: 21
Joined: Thu Jan 25, 2007 8:26 am

Re: Compressing flac to ogg (scummvm talkies)

Post by tobybear »

Jellby wrote:That's probably bad wording on my part. Both flac and sou are obtained from whatever is stored in the original files (let's assume it's wav). Flac is compressed for that, but without reduced quality, sou, while maybe not exactly "compressed", has reduced quality, with frequency reduced to 22050 Hz or something like that.
At least that's my interpretation. What I do know is that the flac file is about twice the size of the sou. If I'm wrong and the sou quality is exactly like flac, then just forget about this :)
Eh, as far as I know, ".sou" IS the original format the sounds were deployed with the game. You can choose to convert this to MP3 (".so3"), OGG (".sog") or FLAC (".sof"), but it will never be better than the original .sou file, at least unless you find some higher-quality external source recordings, which I doubt publicly exist.
Jellby
Posts: 26
Joined: Fri Apr 27, 2007 8:20 pm

Re: Compressing flac to ogg (scummvm talkies)

Post by Jellby »

tobybear wrote:Eh, as far as I know, ".sou" IS the original format the sounds were deployed with the game.
That's in the old original scumm games, but I'm talking about the Special Edition of Monkey Island (2009) and the patch to use its voices with scummvm. The original format here is not sou, but something else that can be converted to sou, flac, mp3...
tobybear
Posts: 21
Joined: Thu Jan 25, 2007 8:26 am

Re: Compressing flac to ogg (scummvm talkies)

Post by tobybear »

Jellby wrote:That's in the old original scumm games, but I'm talking about the Special Edition of Monkey Island (2009) and the patch to use its voices with scummvm. The original format here is not sou, but something else that can be converted to sou, flac, mp3...
Ah yes, for that edition, the original format is WMA, which you can decode to WAV with the known tools. In that case I think you need to keep the extracted and converted files to create FLAC, OGG and MP3 version of it.
Bloodbat
Posts: 30
Joined: Mon May 17, 2010 4:30 pm

Post by Bloodbat »

Same reasoning applies, mind you: a compressed format will NEVER, EVER improve on the original data (it just might sound the same with a lossless compressor such as FLAC, and that is still dependant on what settings you use to compress vs whatever settings the original WMA audio was compressed in).
To sum it up: will FLAC files sound better than ogg files? Depends on the settings used...since the audio is WMA compressed...the most you can get is audio that sounds the same as the original, but never, ever, better (at least as far as audio data itself is concerned).
User avatar
MusicallyInspired
Posts: 1136
Joined: Fri Mar 02, 2007 8:03 am
Location: Manitoba, Canada
Contact:

Post by MusicallyInspired »

FLAC will never sound better or worse than the source material. FLAC doesn't compress the actual audio data like lossy codecs such as MP3, OGG, and WMA do. It's more like a data container, like ZIP. There is no actual loss of audio data. That's why it's lossless. The settings you choose when encoding to FLAC do not affect the audio quality at all.
Jellby
Posts: 26
Joined: Fri Apr 27, 2007 8:20 pm

Post by Jellby »

Bloodbat wrote:To sum it up: will FLAC files sound better than ogg files?
That was not my point, but rather that FLAC files sound better (in this case) than SOU.

I'd like to keep a single master "monster" file from which I can build the compressed versions when/if needed. Currently, it seems the only option is the SOU file, but that's not giving the best quality available (again, in this case, for the MI Special Edition).

So, my question was whether there's a way to obtain the compressed files from the FLAC. If there is no easy way, my suggestion is to modify the compression tools to support a FLAC file as input (in principle, all the information needed is there). I realize this could cause some concern because it could be viewed as helping pirates, but still, I believe there's a legitimate use for this.
User avatar
md5
ScummVM Developer
Posts: 2250
Joined: Thu Nov 03, 2005 9:31 pm
Location: Athens, Greece

Post by md5 »

Jellby wrote:
Bloodbat wrote:To sum it up: will FLAC files sound better than ogg files?
That was not my point, but rather that FLAC files sound better (in this case) than SOU.
SOU is a container format, like a ZIP file, which contains sound files, which could also be FLAC files. Don't confuse apples with oranges.
Jellby wrote:Currently, it seems the only option is the SOU file, but that's not giving the best quality available
Re-read the previous replies, you can't magically improve sound quality just by converting the sound format. The SOU file contains the original audio. You can't improve the original audio by converting it to FLAC.
Jellby wrote:my suggestion is to modify the compression tools to support a FLAC file as input
...why? I really don't get this

To sum up: unless you somehow have access to the original studio recordings, there is NO WAY you can get improved audio by converting an already existing recording to another format.
Jellby
Posts: 26
Joined: Fri Apr 27, 2007 8:20 pm

Post by Jellby »

md5 wrote:Re-read the previous replies, you can't magically improve sound quality just by converting the sound format. The SOU file contains the original audio. You can't improve the original audio by converting it to FLAC.
I understand the basics of lossy/lossless compression. Maybe my wording was unfortunate again. With SOU I mean the "monster.sou" files that originally came with scumm games and, in particular, the one generated by the MI Special Edition patch, as opposed to "monster.sof", "monster.sog", "monster.so3". The underlying format is probably VOC, or WAV, or some raw audio.
md5 wrote:
Jellby wrote:my suggestion is to modify the compression tools to support a FLAC file as input
...why? I really don't get this
Because the MI Special Edition does not have anything that can be directly used by compress_scumm_sou. At the moment we have to use the patch (Windows-only) to generate all the "monster" files. And what I'd like is to have only one (with best quality) and be able to build the others with compress_scumm_sou (or whatever).

The current solution would be to create "monster.sou" with the patch, and use it to generate the other files, but I believe the quality of this "monster.sou" file is lower than that of "monster.sof". Because:

1. It's size is about half.
2. The original sound files, in this game, are not in a "monster.sou" format, but in WMA (see above).
3. I think I've read somewhere that in order to generate the "monster.sou" file, the quality had to be somewhat reduced (here, though it could be outdated)
md5 wrote:To sum up: unless you somehow have access to the original studio recordings, there is NO WAY you can get improved audio by converting an already existing recording to another format.
No, but I have access to the WMA files, which are better than the "monster.sou" file generated by the patch.

To summarize: the assumption that the "monster.sou" file gives the "best" available quality was valid for the old scumm games, but it may not be so for the Special Edition. But if anyone can confirm that I'm wrong and that the WMA files are indeed not better than what's written in the "monster.sou", then we can forget this whole thread :)
Bloodbat
Posts: 30
Joined: Mon May 17, 2010 4:30 pm

Post by Bloodbat »

I *kind of* understand what you want to do...after reading your link (and looking at the true monster.sou bit, as I gather from that post, since I'm quite sleepy).
ScummVM *probably* doesn't have that restriction (kHz and such), but that is probably better answered by the developers.
I don't think you'll use an .exe hack...since you're posting here and I doubt .exe hacks support all those formats ScummVM does.
If you want lossless quality...use flac, but it won't get better than the files you used for compression (even if they're half the size or whatever).
*If* ScummVM doesn't mind about "a true monster.sou with 22 kHz, 8 bit throughout" you could use it sans compression or do a decent .ogg file to save space (it would probably be smaller than a .flac).
BUT and here's the thing...if the patch produces a monster.sou with those specs (22 kHz and such), no matter what you do...the only way audio quality will change is for the worse if compressed with a lossy format, even with those WMAs you have.
If you have the special edition (it can look modernized or classic...) why go through all this trouble anyway? Maybe to use it under Linux? Does it work with Wine?
Jellby
Posts: 26
Joined: Fri Apr 27, 2007 8:20 pm

Post by Jellby »

Bloodbat wrote:I don't think you'll use an .exe hack...since you're posting here and I doubt .exe hacks support all those formats ScummVM does.
No, I only plan to use it with ScummVM.
Bloodbat wrote:If you have the special edition (it can look modernized or classic...) why go through all this trouble anyway? Maybe to use it under Linux? Does it work with Wine?
Exactly. I want to use it under Linux, or Android, or a Nintendo DS... But using it is not a problem, I can build some format with the patch and use it now. What I want is to have have something from which I can build other formats, under Linux, in the future, something I can use as a sort of backup. With other games I can just store the monster.sou file, with this one I'd need to go back to Windows
Bloodbat wrote:*If* ScummVM doesn't mind about "a true monster.sou with 22 kHz, 8 bit throughout" you could use it sans compression or do a decent .ogg file to save space (it would probably be smaller than a .flac).
BUT and here's the thing...if the patch produces a monster.sou with those specs (22 kHz and such), no matter what you do...the only way audio quality will change is for the worse if compressed with a lossy format, even with those WMAs you have.
ScummVM can use the monster.sou all right, and I guess 22 kHz, 8 bit is what monster.sou files in other games are. But the key here is that the original WMA files are probably 44 kHz, 16 bit. So, the monster.sou has lower quality than the original, and storing it means I'm already losing quite a bit.

The FLAC created with the Windows patch has the whole WMA quality, and in principle it's an excelent candidate for storing. I can use it for playing as well, that's not the problem. But I can't build OGG or MP3 files from the FLAC, I'd need to install the game in a Windows machine and rerun the patch, while it would be so easy with compress_scumm_sou... :(
Post Reply