Question about sound encoding
Moderator: Forum Moderators
- hyperactivething
- Posts: 45
- Joined: December 8th, 2007, 5:35 pm
- Location: Santiago, Chile
Question about sound encoding
I was looking throught he sounds directory and I was surprised to see that many files were in wav format. (50 in total...I'm using 1.2.
So I was wondering why these were not encoded into ogg, like the rest. Are there any specific reasons? Or was it just a 'missed a spot' situation?
So I was wondering why these were not encoded into ogg, like the rest. Are there any specific reasons? Or was it just a 'missed a spot' situation?
Here's how it went, more or less:
1) Originally, all the sounds were in .wav. Probably for no particular reason, it was the format the original set of sounds happened to be in and .wav is easiest to work with. No problem with space, as there were so few of them (1.14MB for all sfx of 1.0.2 ).
2) Then, I started to make more sounds and add most of them as .ogg's, to save space.
3) Then, I figured that not having the original .wav's around is stupid, because .ogg is a lossy format and thus all possible subsequent editing should be done on the lossless .wav's instead (and then converted to .ogg's again). So, I didn't quite know whether to just use .wav instead or use .ogg and try to keep the .wav's myself somewhere. However, since I also started making stereo sounds instead of mono, the filesizes started doubling so .wav became very unfeasible, so we came up with this:
4) We now have a location in the SVN repository for storing the master .wav's of sounds, and the intention is to convert all sounds in the release packages to .ogg's sooner or later, and have the master .wav's in the separate location so people can use those when they need the lossless version. It just hasn't been done for all sounds yet.
1) Originally, all the sounds were in .wav. Probably for no particular reason, it was the format the original set of sounds happened to be in and .wav is easiest to work with. No problem with space, as there were so few of them (1.14MB for all sfx of 1.0.2 ).
2) Then, I started to make more sounds and add most of them as .ogg's, to save space.
3) Then, I figured that not having the original .wav's around is stupid, because .ogg is a lossy format and thus all possible subsequent editing should be done on the lossless .wav's instead (and then converted to .ogg's again). So, I didn't quite know whether to just use .wav instead or use .ogg and try to keep the .wav's myself somewhere. However, since I also started making stereo sounds instead of mono, the filesizes started doubling so .wav became very unfeasible, so we came up with this:
4) We now have a location in the SVN repository for storing the master .wav's of sounds, and the intention is to convert all sounds in the release packages to .ogg's sooner or later, and have the master .wav's in the separate location so people can use those when they need the lossless version. It just hasn't been done for all sounds yet.
- hyperactivething
- Posts: 45
- Joined: December 8th, 2007, 5:35 pm
- Location: Santiago, Chile
Yeah, I was aware that you had to keep the originals somewhere in a non-lossy format for further edition. It just seemed strange to me that they came packaged with the game as well.
I'm just curious as to why it hasn't been done for all sound files. I mean, oggenc doesn't take much time to encode short sfx files. I'll have a look around in the repository anyways.
I'm just curious as to why it hasn't been done for all sound files. I mean, oggenc doesn't take much time to encode short sfx files. I'll have a look around in the repository anyways.
For very short sounds the overhead of the ogg container makes the vorbis encoding useless.
WesCamp-i18n - Translations for User Campaigns:
http://www.wesnoth.org/wiki/WesCamp
Translators for all languages required: contact me. No geek skills required!
http://www.wesnoth.org/wiki/WesCamp
Translators for all languages required: contact me. No geek skills required!
- vonHalenbach
- Translator
- Posts: 398
- Joined: May 3rd, 2006, 10:23 am
- Location: united europe
How about using FLAC in the first place? Does SDL support flac? It is lossless and small. Encoding needs more computing power than decoding, so it is easier to decode than ogg-vorbis. Then we don't need to store some masterfiles additionally and all are happy playing Battle for Wesnoth.
http://brilliantanyway.blogspot.com/ Brilliant Anyway
- hyperactivething
- Posts: 45
- Joined: December 8th, 2007, 5:35 pm
- Location: Santiago, Chile
I've never tried to encode a .wav into an .ogg and found the filesize to increase.
I've wanted and suggested FLAC myself, but SDL doesn't support it.
I've wanted and suggested FLAC myself, but SDL doesn't support it.
Yes, but you also have to update all references to those sounds in the code and WML, since the filenames need to change along with the format. Not hard, just a bit of grunt work. For little gain, at the moment.hyperactivething wrote:I'm just curious as to why it hasn't been done for all sound files. I mean, oggenc doesn't take much time to encode short sfx files.
just to add a point to zookeeper's history report
the original entry of .ogg wasn't for sound, but for musics... having a 4' piece of wave was completely impracticall
for a long time, all sounds were wav and music ogg, it's only recently that we started having ogg sounds lying around...
the original entry of .ogg wasn't for sound, but for musics... having a 4' piece of wave was completely impracticall
for a long time, all sounds were wav and music ogg, it's only recently that we started having ogg sounds lying around...
Fight key loggers: write some perl using vim
That's true. I never founded a wav music in this game. But can you show me a .wav/.mp3 to.flac encoder for Linux/Unix? I have mp32ogg to change the .mp3 encoding into .ogg, but what about .flac? I don't think that a deep search into Synaptic would actually work, 'cos many things ain't there.Boucman wrote:just to add a point to zookeeper's history report
the original entry of .ogg wasn't for sound, but for musics... having a 4' piece of wave was completely impracticall
for a long time, all sounds were wav and music ogg, it's only recently that we started having ogg sounds lying around...
Trust yourself first, then trust others.
Current activity/ies: what...!?
Current activity/ies: what...!?
- West
- Retired Lord of Music
- Posts: 1173
- Joined: October 30th, 2006, 7:24 am
- Location: In the philotic connections between ansibles.
- Contact:
Why would you want to convert mp3 to flac? The mp3 file is already "ruined" as mp3 is a lossy format. All you gain by converting it to a lossless format is excessive filesize, it won't sound any better.dontano wrote:That's true. I never founded a wav music in this game. But can you show me a .wav/.mp3 to.flac encoder for Linux/Unix? I have mp32ogg to change the .mp3 encoding into .ogg, but what about .flac? I don't think that a deep search into Synaptic would actually work, 'cos many things ain't there.
I'd be glad to:
1) Try encoding my music tunes with FLAC
2) Implement Ogg FLAC support on Wesnoth!
If you can provide me a good comparison of results between Ogg Vorbis and Ogg FLAC.
1) Try encoding my music tunes with FLAC
2) Implement Ogg FLAC support on Wesnoth!
If you can provide me a good comparison of results between Ogg Vorbis and Ogg FLAC.
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
- hyperactivething
- Posts: 45
- Joined: December 8th, 2007, 5:35 pm
- Location: Santiago, Chile
West is right. Just ogg it, turning it into a flac file is pretty pointless.dontano wrote:But can you show me a .wav/.mp3 to.flac encoder for Linux/Unix?
Shadow Master, isn't comparing vorbis and flac a bit pointless? One is lossy, one is lossless, it's obvious one encoding will always be larger than the other one. Or did I misunderstand the question?
- West
- Retired Lord of Music
- Posts: 1173
- Joined: October 30th, 2006, 7:24 am
- Location: In the philotic connections between ansibles.
- Contact:
I *think* Shadow Master is talking about the overhead of using flac as opposed to using vorbis. I.e. if flac eats a lot more cpu cycles, using it might not be practical even if the sound quality gets (slightly) better.hyperactivething wrote:Shadow Master, isn't comparing vorbis and flac a bit pointless? One is lossy, one is lossless, it's obvious one encoding will always be larger than the other one. Or did I misunderstand the question?
- hyperactivething
- Posts: 45
- Joined: December 8th, 2007, 5:35 pm
- Location: Santiago, Chile
Oh. Well, anyways, I thought sending lossy-encoded files with the game was not being discussed, I thought it was a discussion about how to store files in the repository for further edition.West wrote:I *think* Shadow Master is talking about the overhead of using flac as opposed to using vorbis. I.e. if flac eats a lot more cpu cycles, using it might not be practical even if the sound quality gets (slightly) better.
My opinion would be to package ogg files with the game, and store the originals as flac files in the repository. I think that makes more sense.
- vonHalenbach
- Translator
- Posts: 398
- Joined: May 3rd, 2006, 10:23 am
- Location: united europe
I converted a 2 channel wav file (1second long) into flac and ogg.Shadow Master wrote:I'd be glad to:
1) Try encoding my music tunes with FLAC
2) Implement Ogg FLAC support on Wesnoth!
If you can provide me a good comparison of results between Ogg Vorbis and Ogg FLAC.
1 second wav = 248KB
1 second flac = 119KB
1 second ogg = 25,4 KB with 128 Kbit/sec rate.
Decoding power on a wav is almost nonexistent, because you copy them just around. Decoding of ogg needs a bit of processing power. Decoding of flac is lesser cpu-intensive as ogg.
To compress a wav file, you get about 60% filesize as flac. This is not much, but better then storing them as wav. It makes only sense for the music files imho. The sounds should stay as wav.
http://brilliantanyway.blogspot.com/ Brilliant Anyway