• Advertisement

Archived

This topic is now archived and is closed to further replies.

preferred file format for music in a game??

This topic is 5036 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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 !

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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)

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
i vote for Ogg Vorbis. Besides being open souce and patent-free, it''s slightly smaller and slightly better than MP3 formats.

However, it should be noted that the biggest advantage it has over MP3 is in the low bitrate areas. At the normal rate that most people listen to music with, it''s not much difference. at low bitrates, i''s noticably better quality for the same space.

Share this post


Link to post
Share on other sites
Ogg Vorbis definitly. You can use Vorbis easily with OpenAL too. I recommend both of them. They make cross platform development much easier.

Share this post


Link to post
Share on other sites
I would vote not to change them (MP3 is already widely accepted), if you really want to you should try Ogg Vorbis as others have sugested.

Not real familiar with sound but I recently got a free program called "Audicity" (Google will help you find it) that can read/write .wav .mp3 and .ogg files. You may want to have a look at it, perhaps it may be a little smarter in converting the .mp3''s. I dunno much about it though, as I said; perhaps it wouldn''t help much.

Share this post


Link to post
Share on other sites

  • Advertisement