News:

Want to praise Simutrans?
Your feedback is important for us ;D.

How to make Simutrans play custom music?

Started by IgorEliezer, January 03, 2015, 02:23:52 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

IgorEliezer

Theoretically, Simutrans can play custom music that is saved in /simutrans/music. If you open the said directory you'll find the readme.txt, which says:

QuoteYou can put your own music files here. Edit music.tab to list them
and Simutrans will read and play them.

Good. Say, I downloaded this track (Mr Mealeys Mediocre Machine.mp3) and saved in the proper directory.

Then I edited music tab:

# music.tab
music/01-Mr Mealeys-Mediocre-Machine.mp3
Mr Mealeys Mediocre Machine


I don't know if the hyphens and the "01-" are necessary. Needlessly to say the file name also reflects the name in the tab file.

And, it didn't work. The "Sound" dialog displays the same of the music (01 Mr Mealeys Mediocre Machine), and the "Mute" button is not pressed, but I can't hear anything.

I'm guessing Simutrans doesn't support mp3.

Ters

Last I checked, Simutrans played MIDI music only. Supporting files of various formats is quite complex requiring libraries almost as big as Simutrans itself. There are also patents involved with many of them. I think we discussed supporting Ogg Vorbis once, which is an open format, but the format is almost unknown, despite being the only format used on Wikipedia for audio (or was for some time). For sound effects, Simutrans only supports uncompressed sound, but uncompressed music takes a lot of space, unless the quality is cranked way down.

prissi

Simutrans will play any files when compiled with SDL_mixer. Otherwise only midi and wav.

NNW

Quote from: prissi on January 06, 2015, 09:32:36 PM
Simutrans will play any files when compiled with SDL_mixer. Otherwise only midi and wav.

I have tested 120.0.1 with and without sdl, with mp3 and wav.
Simutrans dont play any music but midi, regardless of sdl or not.

An_dz

SDL_mixer != SDL

You need to compile it yourself to compile with SDL_mixer.

kierongreen

I'm not sure SDL_mixer build is even supported on Windows? I put it in because it was the easiest way to get MIDI playback on Linux. The other formats were a bonus (although there is issues with the sample rate for those!).