The International Simutrans Forum

 

Author Topic: Support of OGG music format  (Read 4749 times)

0 Members and 1 Guest are viewing this topic.

juhis

  • Guest
Support of OGG music format
« on: August 26, 2008, 09:11:20 AM »
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?

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9584
  • Languages: De,EN,JP
Re: Support of OGG music format
« Reply #1 on: August 26, 2008, 10:08:32 AM »
No, because this cannot be done in a useful portable way on many platforms.

Offline Nathan Samson

  • *
  • Posts: 89
Re: Support of OGG music format
« Reply #2 on: August 26, 2008, 12:27:37 PM »
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.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9584
  • Languages: De,EN,JP
Re: Support of OGG music format
« Reply #3 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 ...

Offline Nathan Samson

  • *
  • Posts: 89
Re: Support of OGG music format
« Reply #4 on: August 26, 2008, 02:45:24 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

  • Guest
Re: Support of OGG music format
« Reply #5 on: August 26, 2008, 05:22:50 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.

Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2269
Re: Support of OGG music format
« Reply #6 on: August 27, 2008, 09:29:56 AM »
Hint - other music formats are already supported through SDL Mixer (there is some problems with frequency though...) - try it!

Offline Raven

  • Web Team
  • *
  • Posts: 35
Re: Support of OGG music format
« Reply #7 on: August 27, 2008, 09:35:24 AM »
I've always thought that .mid format suits perfectly an old school game such as simutrans.

Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2269
Re: Support of OGG music format
« Reply #8 on: August 27, 2008, 09:37:21 AM »
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

  • Guest
Re: Support of OGG music format
« Reply #9 on: September 11, 2008, 05:13:14 AM »
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.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9584
  • Languages: De,EN,JP
Re: Support of OGG music format
« Reply #10 on: September 11, 2008, 08:35:18 AM »
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.

Offline marioxcc

  • *
  • Posts: 125
  • GNU is not UNIX
Re: Support of OGG music format
« Reply #11 on: December 03, 2008, 01:07:17 AM »
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.
« Last Edit: December 03, 2008, 01:35:32 AM by marioxcc »

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9584
  • Languages: De,EN,JP
Re: Support of OGG music format
« Reply #12 on: December 03, 2008, 11:08:00 PM »
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.

Offline marioxcc

  • *
  • Posts: 125
  • GNU is not UNIX
Re: Support of OGG music format
« Reply #13 on: December 03, 2008, 11:36:12 PM »
is much more open than any non-standard open file format
Well, if you say it, i trust.