Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

What is the most convenient music format for video games?

A topic by mescalina azul created 20 days ago Views: 563 Replies: 30
Viewing posts 1 to 22

... Ogg? MP3? WAV? Or maybe something else?

In other words: you create a game, and now it's time to add the music tracks. What format do you find most convenient?

I'm working on some music tracks to complete a package, and I'd like to have this information. That way I'll know what format to export them in.

Thanks.

(+1)

I use MIDI files (.mid).

(+1)

First, I haven't seen ogg files in a long time, I never use them so I don't know what's up with them. wav files are technically higher quality than mp3 because they're uncompressed, but mp3s take up so much less space.  I have a music file I created which in its wav form is 40MB, but converted to mp3 is 3MB. 

For this reason, I suggest using mp3s because the difference in quality (as far as I know) is not noticeable, but the difference in size is definitely noticeable.

Hope this helps

(+1)

You could always include multiple file types, but that takes up even more space

Yes, that's the dilemma, hehe.

(+1)

Mp3 and ogg are both compressed music. Mp3 is an older proprietary format, very wide spread. Ogg is a newer open source format, supported by most games engines and libraries. Ogg has slightly better compression.

(+2)

Depends on the engine!

(+5)

I'd argue that when selling game assets, you should provide a lossless format like FLAC and let the customer worry about compression tradeoffs and target formats.

(1 edit)


Greetings.

Actually, it's a free and open-source package. The package will include quite a few tracks, so I'm not sure if it would be feasible to distribute it as an uncompressed file. If I remember correctly, itch doesn't allow files larger than one gigabyte.

In any case, I'll examine the FLAC files (I'm not very familiar with them).

You're right that the best thing to do is distribute the files uncompressed and then have everyone convert them to the format they prefer. I assume everyone has the resources to do that.

Thanks for your perspective.

(1 edit)

Two points here:

a) even if your product is free, you presumably want people to use your stuff. That means you should make it easy to use your files for as wide an audience as possible. My point still stands.

b) when we say "uncompressed", we mean"losslessly compressed". Putting your stuff in  a zip file is fine.

c) a gigabyte is a lot of music - even in an uncompressed format, you can fit about an hour of CD quality audio in there.

(My points were losslessly compressed into 66% of their original size. I did not miscount or make a typo.)

(+4)

Depends a bit. But you do not care how the user will be able to play the files. You care about latency, licenses, storage size, computational load and so on.

Therefore devs avoid mp3. Licensing is not as much an issue today, is it was earlier. But the latency and looping tracks still is. Storage wise, there is no real difference between ogg and mp3. And if computation load is an issue, you use uncompressed wav for short sound effects.

If you are using a game engine, read the recommendations of that engine.

(+2)

I distribute my games with music in opus format, which I have found gives the best quality to file size ratio.  However, I prefer to do my own compression so that I can control the compression level.  I use flac exclusively during development, which offers good compression with perfect (losssless) quality.

I can convert other lossless formats (e.g. wav) to flac if I have to.  I refuse to use other lossy formats like mp3 and ogg.

(+1)

Handling master files lossless is prudent.

(2 edits) (+1)

This question seems very engine and legal-compliancy dependent.  but generally speaking the most desirable format is not always the best format in terms of distribution and execution. ideally you want lossless compressed audio for everything with minimal file-size and near-zero computation. 

it's probably a good idea to simply release your pack in multiple formats. 

typically music itself winds up being lossless and computationally expensive, whereas sound effects lean more lossy with much lower compute times.   then you have like flac or something for archives 

(+1)

i would use ogg if you can

Yes. I thought maybe OGG was a suitable format for any developer (OGG is what I use). But looking at all the responses, I see there's quite a diversity of opinions. Now I'm more confused than before, hehe...

I remember when the ogg format was promoted a lot in certain circles. But these days, there appears to be a lot of competition between formats, especially with game engines seeming to diversify.

(+2)

As several people have mentioned, sound effects are most commonly in WAV format. Since you have to run many of them and they need to be synchronized with what you see, CPU usage is prioritized.

Music, on the other hand, since it's usually one or two simultaneous tracks, prioritizes file size, so compressed formats are common. And because most players won't notice a difference, lossy formats like MP3 and OGG are generally preferred.

MP3 used to be a proprietary format (I believe the license has changed since then), so depending on the engine you were using or if you were using libraries, OGG was often recommended. From a technical standpoint, there isn't usually enough difference to justify using one over the other. Some people prefer MP3 and will give you good reasons, others use OGG and will also give you good reasons. I'd say that, historically, MP3 is slightly more common than OGG.

Formats like FLAC aren't commonly used because they take up more space, and most players won't notice the difference.

The problem is that you're talking about creating a developer pack, NOT one for the end user, and that changes everything. Some developers prefer MP3, others prefer OGG, some want FLAC, and still others even WAV. Choosing one or the other will only cause you to lose parts of your potential audience, so it's best to offer it in several versions, and ideally, make your main version a lossless one. This way, each developer has the freedom to adapt the audio to their needs instead of forcing them to choose what you consider the most common format.

Interesting and concise answer.

Due to space constraints, I think splitting the package into an OGG version and an MP3 version would be a good idea.

Initially, I'd like to distribute the package as a WAV file. However, I think it will be a package with many tracks, and that might exceed the gigabyte limit allowed by ITCH.

(+1)

Mp3 is best for music OGG and WAV are best for sound effects.

(+1)

it depend render you want

.flac is studio quality and its high weight (best quality)

.ogg is light and good for videogame (medium quality)


personaly i use mp3 22kertz or less for have an oldschool timbre (low quality)


more quality = more weight

so you have to adapte for what you need

(for exemple for a game like guitare hero you should use .flac, for a 8bitgame you can just use mid(ugly) or ogg)

Hey mate!

I’d recommend using .ogg files; 

I’m no expert on the subject, but I’d say it’s the format that best balances quality and compression.

Good luck with your project 😘

Thanks to its compression ratio, MP3 has always been the wiser choice, in my opinion. It keeps your game size small and, in many cases, game engines, like Phaser 3, import them quite easily.

It just depends on how much music you have in your game, and how much ambience is in the tracks. If you need something with high clarity and details, OGG is definitely your best bet. I would never recommend WAV for a game, due to its large file size and lack of fidelity (games tend to drop frames and, when they do, the music tends to stutter along with it).

Of course, I’m only speaking from my own experience. Your mileage may vary.

I'm using MP3 because the public domain music I use came in that format. File size matters to me. So far I haven't had issues with delays. If necessary the Unity engine also has the possibility to schedule the start of tracks for a specific time, which allows to synchronize tracks.

As someone who has written sound/music mixing code for games, I will say that OGG/MP3/WAV/OPUS are effectively the same thing. You can easily convert from one to the other using FFMPEG. The only thing that matters is that the original file is high quality. Also, people often think of WAV as being uncompressed PCM, but in reality WAV can also contain compressed formats like FLAC/MP3/VORBIS. An MP3 codec is included by default in Windows (since 2000/XP) so for my engine I convert music to WAV files containing MP3 audio, then decompress using Windows ACM calls and mix in sound effects (as uncompressed WAVs) in real time. Works fine on an old Pentium III.

MIDI and tracker formats like .XM are a different beast, and these can be great for retro or console games.

(2 edits)

MP3 is proprietary.  You should avoid using it.

WAV will work, but it's a bit bloated for projects and is more useful to store a raw source for the audio created.  OGG is old enough just about anything should be able to support it.  Even old school WInamp can support it.  The only issue I have with MIDI is it depends on what sort of sound font is setup on the player end (Yeah, I know, people get irate for me calling it that, but I'm going with that because it's easier to understand).  Like, with me, I have a custom font setup because I have worked with MIDI before, so the file would sound quite different on my end as opposed to someone using a default setup.

Mine is almost unheard of here, but I use web oscillator for my projects.  I have been working with it over the years to try to make custom waveforms that sound a little more like actual instruments (I do have a fairly mean-sounding bass and pipe organ waveform) and it has a  ridiculously low filesize since it uses the web browser itself to generate and play the music.

(1 edit)

I agree about MIDIs. To me, making MIDIs that both sound great and translate well while sounding different across machines… can tend to require a certain oldschool knowledge of music production and techniques (usually that’s beyond just pressing “export” in some program, but maybe mileage can vary).

(+1)

The MIDIs in my games will sound the same on every machines because I provide the soundfont and I've configured SDL2 to load the provided soundfont.

(+1)

From what I’ve seen, OGG is probably the most convenient music format for video games. It gives a good balance between file size and audio quality, and it loops well, which is super important for background music. WAV is great for short sound effects because it’s uncompressed, but it gets heavy if you use it for full tracks. MP3 works too, but it’s not always ideal for seamless looping. While working on small mobile-style games (like the kind we experiment with on GameVerse by GameGenesis), OGG for music and WAV for sound effects has been the most practical combo—keeps the build size small while still sounding clean.

Someone correct me if I'm wrong here, but in my experience it takes maybe 1 or 2 clicks to convert an audio file. So when I buy assets that have multiple versions of the same file, it's a big plus and makes me remember them for next time.

The main reason for me, as an indie dev, is that it saves time and helps keep my workflow moving if I'm testing out different music and sound effects or for moments when I remember a great asset that went unused from a previous project but now I'm in a different engine. So that little bit of thoughtfulness in asset preparation is really appreciated.

But that's just me :P

+1 for OGG as it's the most requested format I've had when making game engine dlcs