Bring back support for WAV in soundbanks

12 replies [Last post]
OpenWorms2Official
User offline. Last seen 11 years 2 days ago. Offline
Joined: 2013-11-15
Posts: 32

To make players' lives easier.

(Account blocked from further forum access due to reoccurring abuse and misbehavior)

Star and Moon
Star and Moon's picture
User offline. Last seen 5 days 20 hours ago. Offline
Joined: 2010-04-03
Posts: 720
nemo
nemo's picture
User offline. Last seen 19 weeks 4 days ago. Offline
Joined: 2009-01-28
Posts: 1861

http://www.vorbis.com/setup_windows/

--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev

oranebeast
User offline. Last seen 10 years 16 weeks ago. Offline
Joined: 2013-06-10
Posts: 104

WAV is a extension for audio files by microsoft, works best on windows... Ogg is universal and can have great audio quality. And finally audacity is the audio tool that can convert that and much more
Geek

{} {}
\___/ - Happy

nemo
nemo's picture
User offline. Last seen 19 weeks 4 days ago. Offline
Joined: 2009-01-28
Posts: 1861

oranebeast allegedly wrote:

WAV is a extension for audio files by microsoft, works best on windows... Ogg is universal and can have great audio quality. And finally audacity is the audio tool that can convert that and much more
Geek

Wav isn't Windows only, although it did get a bit of a reputation there due to lack of decent bundled codecs for quite a while (still no ogg AFAIK).

And, well. The main issue is that, wav is an uncompressed format so requires a ridiculous amount of space...
Take a typical theme music like Halloween.ogg...
-rw-rw-r-- 1 nemo nemo 3.5M Nov 5 2012 Halloween.ogg

oggdec Halloween.ogg
oggdec from vorbis-tools 1.4.0
Decoding "Halloween.ogg" to "Halloween.wav"
[100.0%]
$ ls -lh Halloween.wav
-rw-rw-r-- 1 nemo nemo 35M Nov 17 20:23 Halloween.wav

A 10:1 difference like this is very typical for ogg of decent quality.

There is no reason to support something so useless when tools to encode ogg are readily available. Anyone capable of a half-decent audio sample will be able to encode in ogg.

--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev

oranebeast
User offline. Last seen 10 years 16 weeks ago. Offline
Joined: 2013-06-10
Posts: 104

agreed, plus thats what i use when making games Smile

{} {}
\___/ - Happy

Star and Moon
Star and Moon's picture
User offline. Last seen 5 days 20 hours ago. Offline
Joined: 2010-04-03
Posts: 720

Also just a note, WAV was never supported in this game, it was ogg files from the start.

For the future, try doing a bit of googling before making a topic like this, for instance searching "Program for Converting Wav to Ogg" though Audicity is probably the best program you can get for this sort of thing.

oranebeast
User offline. Last seen 10 years 16 weeks ago. Offline
Joined: 2013-06-10
Posts: 104

Star and Moon allegedly wrote:

Also just a note, WAV was never supported in this game, it was ogg files from the start.

For the future, try doing a bit of googling before making a topic like this, for instance searching "Program for Converting Wav to Ogg" though Audicity is probably the best program you can get for this sort of thing.

Along with that, consider some facts...
WAV : can have great quality but big size
Ogg : open sourse.. nice quality, small size

Now consider sizes, 82.3mb is the total of all hedgewars size with ogg vorbis compression, with wav hedgwars could be over 300mb... Ouch

{} {}
\___/ - Happy

nemo
nemo's picture
User offline. Last seen 19 weeks 4 days ago. Offline
Joined: 2009-01-28
Posts: 1861

Since people are having fun discussing this...
~/games/hedgewars/Data$ du -hs .
141M .
/tmp/wav$ find /home/nemo/hg/hedgewars/trunk/share/hedgewars/Data/ -name "*.ogg" -exec oggdec "{}" \;
/tmp/wav$ find /home/nemo/hg/hedgewars/trunk/share/hedgewars/Data/ -name "*.wav" -exec mv "{}" . \;
/tmp/wav$ du -hs
832M .

/tmp/ogg$ find /home/nemo/hg/hedgewars/trunk/share/hedgewars/Data/ -name "*.ogg" -exec cp "{}" . \;
/tmp/ogg$ du -hs
73M .

So... wavs would be 11.4 times more space, and cause game Data to use 900MiB of space - 759MiB more than normal.
Now, wavs *are* compressible, so the game zip would not take up that much space.

/tmp/wav$ ls -lh wav.zip
-rw-rw-r-- 1 nemo nemo 755M Nov 18 15:47 wav.zip
/tmp/ogg$ ls -lh ogg.zip
-rw-rw-r-- 1 nemo nemo 72M Nov 18 15:48 ogg.zip

So, in transit, 10.5x more space and 683MiB more bandwidth.

Now, there *is* one use for wav in games. That's to reduce decoding time for sounds you need loaded rapidly when you can't preload sounds into memory. But, I think this is not that helpful a situation since there's still disc access delay, and decoding is very fast nowdays. Better to prefetch if you can, and otherwise decode on the fly.

As for wav vs ogg sound quality. 1) Use flac if you want perfect quality. Saves space. 2) in random blind tests of audiophiles, even 128 bit mp3 was not reliably distinguished from wav.

--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev

jobro
User offline. Last seen 10 years 50 weeks ago. Offline
Joined: 2013-12-05
Posts: 6

Let me put in my point as a musician:

Wav is good, fact is wav is great. I export all my tracks as wav in 24bit 96kHz quality to get the best sound as possible before I packing the file down to mostly mp3. However I must say that for game purposes wav is out of the question since it:

* Takes up way too much place.
* The entire game space would equal 20 minutes of music in stereo 44 kHz.
* Totally unpracticaly to deliver as the download would be humongous in size.

Ogg is the only feasible solution for game development the way I see it, so wav gotta go.

Wuzzy
Wuzzy's picture
User offline. Last seen 25 weeks 2 days ago. Offline
Joined: 2012-06-20
Posts: 1304

Here are my general notes on codecs. I’ll talk about Wav, FLAC, MP3, Vorbis, Speex and Opus.

jobro allegedly wrote:
Wav is good, fact is wav is great. I export all my tracks as wav in 24bit 96kHz quality to get the best sound as possible before I packing the file down to mostly mp3.

Granted, lossless formats won’t gonna die. But Wav is damn old. You may want to convert your tracks to FLAC to save at least a bit disk place. It’s a lossless codec, so you don’t lose anything. But if you want to waste disk space without any benefit, please go on. Wink Smiley

As for lossy codecs, I think MP3 is way too outdated today. Its compression ratio can’t compete to more modern codecs like Vorbis and Opus. I really don’t understand my people still publish new works in MP3.

However, Vorbis is certainly NOT made for speech, only for music. At least that’s what their inventor(s) say. They recommended Speex, which is made for speech. So I find it a bit silly that Hedgewars chose Vorbis for the voices. But now Speex is officially deprecated and they recommend Opus instead.
“Vorbis” is confusingly often called “Ogg” but this is wrong. “Ogg” is the name of a container format, “Vorbis” the name of a codec which is often used together with the container format “Ogg”.

And then there’s Opus. It’s probably the best codec or at least one of the best codecs in existance now, it’s usable for both music and speech because it covers a very large frequency range; in fact the largest range a codec ever had IIRC. Plus, it compresses even better than Vorbis. Plus, it’s also free. I think Opus can make many other codecs obsolete, for example, MP3 and Vorbis. The only downside of Opus has yet that it is not being adapted in many softwares, but more and more softwares start to support Opus.

jobro allegedly wrote:
Ogg is the only feasible solution for game development the way I see it (…)

As I have just shown, this is totally wrong.

Just my two cents.

Hi, I am a Hedgewars developer. Smile

nemo
nemo's picture
User offline. Last seen 19 weeks 4 days ago. Offline
Joined: 2009-01-28
Posts: 1861

Wuzzy, the game uses ogg for everything. Two codecs is a bit inconvenient since ogg is ubiquitous, speex not so much, plus a pain for content generators. And yes, I know vorbis is the codec. Everyone knows that a .ogg is ogg vorbis tho, just 'cause it is the vorbis codec that took off. You're not going to find anything else really.

I don't bother w/ exporting to wav 'cause, frankly, I can't spare the disc space. I just export to ogg and convert to mp3 if necessary.

I think ogg is an excellent choice for games. Good support everywhere, good quality. I guess we could consider shifting to Opus. Would be worth seeing if there's any significant gains for files where only the ogg exists. We'd have to bundle our own lib ofc. That's a minus...

--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev

Wuzzy
Wuzzy's picture
User offline. Last seen 25 weeks 2 days ago. Offline
Joined: 2012-06-20
Posts: 1304

A transition to Opus may not be without problems.
At the moment, all files are in Vorbis.

Simply converting them to Opus won’t be a good idea, you would have to sacrifice quality again. That’s also a minus. We would have to convert the original WAV or FLAC files, if somebody has lying them around.

Actually I consider adding Opus support to Hedgewars to be very low priority and probably not neccessary for now. Opus is better, but Ogg Vorbis is good enough.

I just said all that to add my fourty-two cents into the discussion, not to propose or suggest anything. Wink Smiley

Hi, I am a Hedgewars developer. Smile

User login

Copyright © 2004-2024 Hedgewars Project. All rights reserved. [ contact ]