How to make sound files smaller

Started by paolo, Wed 18/06/2008 21:20:59

Previous topic - Next topic

paolo

I'm adding sound effects to the game I'm working on. Some of the longer effects are over 1M in size.

I don't want the game to end up requiring a huge download, so I'm wondering how I can make the files smaller. Obviously, all the files for the game will be zipped and compressed when the game is released, but already the zip file is 7M big with less than half the game done and the sound effects added to only one room!

Any tips on how to make sound files smaller (like you can do when saving a JPG) with minimal loss of quality? I'm using Audacity to edit the sound effects.

Thanks.

TwinMoon

#1
Maybe I'm stating the obvious, but why not use MP3 or OGG instead of wave?

There's some explanation how to do it in Audacity here.
Some information about MP3 encoders here.

EDIT: The main difference between mp3 and ogg is that mp3 is licensed. (No problem in a freeware game though).
And mp3 adds 0.25 seconds to the beginning and end of a file, which I found out after an hour of wondering why my song didn't loop seamless. :(

paolo

Quote from: TwinMoon on Wed 18/06/2008 21:27:51
Maybe I'm stating the obvious, but why not use MP3 or OGG instead of wave?

Thanks very much, TwinMoon. I'm completely ignorant of the merits of different sound file formats. Is WAV uncompressed and OGG compressed, then? Obviously MP3 would be, if it's anything like MPEG.

TwinMoon

Wave is supposedly raw and uncompressed data. Ogg is a different kind of compression.

I suggest playing around with different bitrates to see what suites you best. Lower bitrates give smaller sizes, but also lower the quality, so you'll have to find the best size/quality balance.

MP3 is mpeg-1 layer audio 3, so it is mpeg ;)

Dualnames

I'd use OGG compression and use preferably use dbpoweramp's plugin about converting sound files to OGG's.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Nikolas

WAV and AIF ARE (not supposedely) uncompressed audio data. At 44.1 Khz and 16-bit (CD quality then), 10 MB is 1 minute of audio.

Usual (and rather good I'd say), settings in both ogg and mp3 compression (lousy, which means that you loose data, as oppossed to RAR/ZIP where it's looseless), you would end up at 1 MB for 1 minute, approximately (according to your settings of course).

Given the nature of sfx, which are... sounds, so they don't need to sound clear, either way, and the fact that chances are you will also have background music playing, even 112 kbits, for mp3, and med quality for ogg would work pretty fine and save you tons of space, if you have been using WAV/AIF instead.

Do note, however, that mp3 and ogg are NOT compressed in RAR/ZIP further. So the size you get in your hard disk is the size you'll end up, for the audio part in the rared folder.

paolo

Thanks, everyone, for the helpful information and your patience with this audio newbie.

I exported my effects from Audacity in OGG format and the file sizes dropped by around 90%, so that's a big saving - 100K is much more acceptable than 1M, and the size of the compressed download file has come down from 7M to 2M, which I'm very happy with.

paolo

Ultra Magnus

Quote from: TwinMoon on Wed 18/06/2008 21:27:51EDIT: The main difference between mp3 and ogg is that mp3 is licensed. (No problem in a freeware game though).
And mp3 adds 0.25 seconds to the beginning and end of a file, which I found out after an hour of wondering why my song didn't loop seamless. :(

Wait, oggs can do seamless looping?
Why wasn't I informed?

I've never used oggs because of the hassle I encountered just trying to play them a few years back (in the days of Winamp 2.5 or so).
I assume that these days most people will be able to play oggs, right?
So if I use them in a game, there won't be any playback issues?
I don't mean to sound bitter, cold, or cruel, but I am, so that's how it comes out.

I'm tired of pretending I'm not bitchin', a total frickin' rock star from Mars.

OneDollar

AGS contains the codec or whatever to play ogg files within it, so people playing your games will be able to hear ogg music reguardless of whether they have anything on their computer that could play them instead. Same with mp3, midi and flic video. AFAIK the only things you need to be worried about are video files; because of the huge amount of codecs you need to make sure you encode any video files you include with your game using a codec that most people have or can get hold of easily.

For the record I use ogg files and do my recording/converting in Audacity (though I'm sure there's some right-click type programs out there that can convert faster - PowerAmp or something?). There's also a download on the ogg vorbis site that lets you play ogg files in Windows Media player, which I have to admit I still use.

Ultra Magnus

Quote from: OneDollar on Fri 27/06/2008 08:50:29
AGS contains the codec or whatever to play ogg files within it, so people playing your games will be able to hear ogg music reguardless of whether they have anything on their computer that could play them instead.

Cool cool.
That's kinda what I was trying to ask, so thanks. ;)
I have had trouble with videos in AGS that I mentioned in t'other thread, so I wasn't sure.
I don't mean to sound bitter, cold, or cruel, but I am, so that's how it comes out.

I'm tired of pretending I'm not bitchin', a total frickin' rock star from Mars.

EldKatt

With risk of stating the obvious (or the uninteresting)... Another point which might be practically relevant to very few, but perhaps philosophically relevant to a few more, is that if you've used mp3 and you ever decide to sell your game, you have to pay royalties to Fraunhofer. Ogg is all free.

Dualnames

I ogg them all. They lose quality barely(mostly not even noticable) if they actually do lose. Then if I want them smaller I ogg them over(I use dbpoweramp). However on the second time quality loss might be obvious.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Ishmael

The more transcoding, the worse the quality. So you might end up with better quality going from unpacked to 128 than going from unpacked to 256 to 192 to 160. I don't know, haven't tested, but it's possible.
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

tube

#13
Quote from: Ishmael on Sat 28/06/2008 03:15:48
I don't know, haven't tested, but it's possible.

Not only possible, but obvious. :)

EDIT: Obvious that you lose quality on every pass, not that the resulting file at 160 kbit/s would be lower quality than the one at 128 kbit/s. Sorry, should read what I'm answering more carefully.

Nikolas

Quote from: EldKatt on Fri 27/06/2008 10:25:55
With risk of stating the obvious (or the uninteresting)... Another point which might be practically relevant to very few, but perhaps philosophically relevant to a few more, is that if you've used mp3 and you ever decide to sell your game, you have to pay royalties to Fraunhofer. Ogg is all free.
I think I've said it before. If the revenues are not high (talking about something around $300,000 per year or so), then there is no royalties. Fraunhofer won't come to get a 2% from the $1000 you've made! Problem lies with the decoding (the player), rather than the mp3s themselves... :)

At least I think so, cause I contacted the company a few years back regarding this very question and licensing issues and that was the impression I got.

radiowaves

Does AGS support Variable Bit Rate, such as for MP3? If it does, you get some converter like Razor Lame.
I am just a shallow stereotype, so you should take into consideration that my opinion has no great value to you.

Tracks

EldKatt

Quote from: Nikolas on Sat 28/06/2008 10:51:04
I think I've said it before. If the revenues are not high (talking about something around $300,000 per year or so), then there is no royalties. Fraunhofer won't come to get a 2% from the $1000 you've made! Problem lies with the decoding (the player), rather than the mp3s themselves... :)

At least I think so, cause I contacted the company a few years back regarding this very question and licensing issues and that was the impression I got.

Heh. I usually try to research my factual claims at least a little before posting them... and the moment I choose not to, it really shows. But yeah, it's my understanding as well that the crux of the matter is shipping a decoder rather than the encoded files. Still, I'm sure you know this stuff better than I.

Nikolas

The story, from my side goes as follows:

I was (and still am) planning to release a big big PDF file about orchestration. And Acrobat pro CAN embed mp3 files on the PDF. So you would get a PDF file, with scores, pics, etc, and along a play button to hear all scores! Neat!

Only acrobat (of course) didn't work with ogg, and only mp3 (and wav which is unacceptable due to size). So I contacted the mp3 creators and asked them, and did get the reply that as long as the revenues are low, there's no issue for a 3% or whatever it is they ask... Once I get my e-mail back, cause the server's down atm, I will check their reply and quote it here...

tube

But if all that you're releasing is a pdf file, wouldn't it be Adobe who pays the royalties? Aren't they the ones who's sofware (acrobat / adobe reader) includes the decoder? A pdf file is just a document after all. Pure data, no decoding functionality. A game, being an executable with an embedded player is probably a whole different matter.

Nikolas

PDF file, WITH an embedded mp3, will have a player.

The player you will have to buy, no royalties for the player. But once you buy acrobat pro, I'm assuming you also get the decoder...

If I was to win more than A LOT of money, then I would be seeing royalties issues from the mp3s themselves (like the mp3s would get a life and start banging on my door :p)

SMF spam blocked by CleanTalk