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 5 days ago Views: 271 Replies: 22
Viewing posts 1 to 16

... 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!

(+4)

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...

(+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.