News:

Simutrans Sites
Know our official sites. Find tools and resources for Simutrans.

Support of OGG music format

Started by juhis, August 26, 2008, 09:11:20 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

juhis

I was just wondering, is there going to be OGG format in the next version of Simutrans?

I know that Midi musics are supported, but there should be other music formats, so is this okay?

prissi

No, because this cannot be done in a useful portable way on many platforms.

Nathan Samson

Can't we have a music-$os.c file with the same functions for each os? (I thought that it was done already this way).

It is then to the music-os.c file to decide what files it could play, and how.

Or maybe a general music.c file that have different loaders (.midi, .ogg, .mp3, ...) and depending on the build options are compiled or not.

prissi

I would suggest using Itunes/Winamp/whatever parallel to simutrans instead. Something to do for the doozing second core of todays machines ...

Nathan Samson

Quote from: prissi on August 26, 2008, 02:35:14 PM
I would suggest using Itunes/Winamp/whatever parallel to simutrans instead. Something to do for the doozing second core of todays machines ...

I can agree with that, but since simutrans has opened the sound card, other programs (like banshee (gstreamer)) cant play sound anymore :(
I guess I could fix that with running simutrans with -nomidi, but then a better option would be to fix simutrans itsels (so it don't block other programs, even when no sound/music is playing in simutrans)

Btw I'm using 100.0 from ubuntu repositories, but I had same problems with self compiled simutrans

juhis

Quote from: prissi on August 26, 2008, 02:35:14 PM
I would suggest using Itunes/Winamp/whatever parallel to simutrans instead. Something to do for the doozing second core of todays machines ...
Then sorry, If I requested that feature, but midi musics are kind of small, but they are not too good comparable to Mp3 format.

kierongreen

Hint - other music formats are already supported through SDL Mixer (there is some problems with frequency though...) - try it!

Raven

I've always thought that .mid format suits perfectly an old school game such as simutrans.

kierongreen

This is true - the current music really wouldn't be that much better as mp3s in my opinion, sounds good the way it is...

GreaseMonkey

I'm sorry this is a fairly old topic, but this *IS* possible if you use SDL_mixer and you have the right libs and you've compiled it right or something like that.

A few problems though:
1. I believe that this behaviour was not intended.
2. You have to somehow encode it at 22500Hz (yes, there was a typo in the source, so it's not 22050Hz, but that may change), as it will only play at that frequency. Your standard 44100Hz OGG will play at roughly half the intended speed.
3. The song doesn't change when it stops AFAIK - this issue happens with WAV files as well as MOD files.

Seeing as most OSes can use SDL + SDL_mixer, it should still be fairly portable if the issues are fixed, but this would only be available with an SDL binary/build. But it shouldn't be too much work, just a bit of dabbling here and there and we may have support via SDL_mixer.

Actually, I might give this a shot myself. I <3 open source software...

EDIT: Issue #3 did not happen when I tested it with an OGG. It does happen with WAVs and MODs though.

prissi

Well SDL is not used on Windows with Unicode support for entring (i.e. all Asian languages) and also not working SDL_mixer for BeOS (at least nothing that works on my BeOS installation). Thus all OS might be a little too general ...

Moreover, SDL_mixer is really a pain with its bugs.

marioxcc

#11
Ogg is a open format.
As far as i know, midi is a propietary format.
1+ for ogg.
EDIT: Changed the translation of "Hasta donde yo sé" from "Unit i know" to "As far as i know", tanks to vilvoh.

prissi

Midi is a general standard since 1983 (refined 1991), which is much more open than any non-standard open file format. Just use OGG on linux, is works anyway.

marioxcc

Quote from: prissi on December 03, 2008, 11:08:00 PM
is much more open than any non-standard open file format
Well, if you say it, i trust.