preferred file format for music in a game??

Started by
11 comments, last by graveyard filla 19 years, 11 months ago
high, ive recently experianced some good luck and found a really good sound guy who is making tracks for my game. hes making mp3''s but im thinking the files are way to big. i dont want to use a crappy .midi format, what are my alternatives? ive heard of .ogg, but am not sure if its smaller or what. i want to have as much music as possible but i also want to keep the file size down. im planning on using SDL_mixer, but am not sure if its best for playing whatever file format ill be using. im definetly willing to learn open AL or FMOD if they are more suited for this. how do all those old school games have good quality music with low file sizes (like a sega or snes game, def dont sound like midi to be and those roms are like 3 mb). thanks for any help !
FTA, my 2D futuristic action MMORPG
Advertisement
check here or here (Search Google for "ogg vorbis")
Ogg is said to need less disk space for same quality, or have better quality while using same disc space.

[Edit: links again]


[edited by - OmniBrain on May 7, 2004 3:36:17 AM]
-----The scheduled downtime is omitted cause of technical problems.
i downloaded a file converter and converted one of his mp3''s to an off, and the file size went from 1 meg to 2.3 megs. was this just because i converted? if he recorded directly into ogg would it be much smaller? how much exactly? is it a very slight difference? if it is, then i dunno if i could use this. isnt there a small music format besides midi? how did those sega games compress there audio? thanks again...
FTA, my 2D futuristic action MMORPG
What program does the "sound guy" use?
Maybe he uses a tracker and just exports/records as Mp3 to harddisk?

In that case exporting to ogg would only be slightly different.
Try to find out what program the guy uses and if the library you use supports the file format of that program.
Maybe he can save as MOD, S3M, XM, and IT ... dunno. That would make a difference.

Midi isn''t smaller because it is more compressed you know ...
You could compress Mp3 as well as ogg even more or less ...

---
If nothing works the way it should ... maybe you need a break!?
Get cracking and double-check the switch statements!!
Tolop|Andyart.de
Writing errors since 10/25/2003 2:25:56 AM
Have you ever tried playing MIDI through the Microsoft Synthesiser? Direct Music allows you to do that pretty easily and MIDIs sound great!

Don''t underestimate the MIDI format; what sucks is the default instrument set. With high-quality samples, MIDI can sound almost like an MP3. And I''m serious.
quote:Original post by RuneLancer
Have you ever tried playing MIDI through the Microsoft Synthesiser? Direct Music allows you to do that pretty easily and MIDIs sound great!

Don''t underestimate the MIDI format; what sucks is the default instrument set. With high-quality samples, MIDI can sound almost like an MP3. And I''m serious.


Quoted because it''s true. If you are coding for windows, the DirectMusic formats are an awesome way to go and DirectMusic directly supports the loading of custom DLS instrument banks (the instruments internally also support any form of ACM compression including mp3, gsm, etc), which is more powerful than mods. What I usually do is get sf2''s and convert them to DLS format and use them with DirectMusic formats. Another benefit of the formats are that they directly support audio scripting for a quick way to develop interactive music, and they even have support for providing chord maps, song variability, and realtime composition of transitions. It''s all really great. DirectMusic Producer (the sequencer, which also imports midi files) you can get for free with the DirectX SDK extras, and DirectMusic itself is very well documented.
Concerning your original question on how oldschool 2D gaming consoles store their music, it''s actually quite similare to MIDI. Basically, you have a partition with notes and the likes, and sound files played at a varying pitch to mimic notes.

The NES had four channels: a sine wave, a sawtooth wave, a triangle wave, and some other "bass" simulation. Music AND sounds were acheived by applying varying tensions on the four channels. The GameBoy did something similare.

The SNES used a programmable chip called the SPC7000. The instruments were stored in the game rom as sounds and were loaded into the chip, along with a programmable partition (notes and all that stuff). The chip would then play by adjusting the pitch and duration of the various "instrument" waves. This is, frankly, the exact same set-up than MIDI.

Newer games use compressed music formats somewhat like, say, MP3 or OGG (which, really, isn''t THAT different in size from MP3).

It all boils down to this: use MIDI. Oh, wait, rather... use MIDI properly You can do a lot more with it than you probably think. A LOT more.
OGG is good - the files are slightly smaller and the quality is, generally speaking, slightly better than MP3. However, converting MP3 to OGG will cause poor quality and possibly large files - what you really want to do is take a wave file and encode it as an OGG.
However, the most significant factor which you have possible overlooked is that MP3 is not free. If you wish use the MP3 file format in your product then you are legally required to pay the company a large sum of money.
On the other hand, OGG Vorbis is free, and is better anyhow. The choice is therefore rather simple.
quote:i downloaded a file converter and converted one of his mp3''s to an off, and the file size went from 1 meg to 2.3 megs.

NEVER convert an MP3 to an OGG, or otherwise convert data encoded lossily to another lossy format. Not only do you lose quality, but the file size can go way up, just as your example illustrates.

So, even though everyone should know this already, here are the rules:
lossless --> lossy: OK (quality and size decrease)
lossy --> lossless: OK (identical quality, but size increases)
lossy --> lossy: BAD (quality decreases and size increases; both dramatically)
quote:Original post by RuneLancer
The NES had four channels: a sine wave, a sawtooth wave, a triangle wave, and some other "bass" simulation.


White noise on the last channel, I thought.

And it takes a fair amount of skill to hack out anything that sounds at all good on that kind of setup :\ But yeah, you can do a lot with MIDI. If you do decide to go with OGG, remember there is a quality setting you can use when encoding - you can crank it way down and still get a better-sounding result than what you''re probably thinking of when you think of MIDI.

This topic is closed to new replies.

Advertisement