Not logged inGosu Forums
Forum back to libgosu.org Help Search Register Login
Up Topic Gosu / Gosu Exchange / [Solved, somehow] Cannot load MP3 songs
- - By Nanaya Date 2011-01-08 17:07 Edited 2011-01-08 17:28
Hi everyone,

Today I was learning a few about sound with Gosu, but I've got a little problem, very annoying.
If I use "Sample", I can use mp3 without any problem, but the quality is pretty bad (it seems to be play in a hall, with a lot of echo ; and the sound have a lot of noise, may should I fit the volume or something else ?).
But in the other hand, when I use "Song", the mp3 files have a "RuntimeError" :

'
C:/Program Files/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/gosu-0.7.25-x86-mingw32/lib/gosu/patches.rb:36:in initialize': MP3 file playback not allowed (RuntimeError)
        from C:/Program Files/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/gosu-0.7.25-x86-mingw32/lib/gosu/patches.rb:36:in
initialize'
        from C:/Documents and Settings/Julien/Mes documents/Ruby/Programmes/Full_HD/lib/main.rbw:19:in new'
        from C:/Documents and Settings/Julien/Mes documents/Ruby/Programmes/Full_HD/lib/main.rbw:19:in
initialize'
        from C:/Documents and Settings/Julien/Mes documents/Ruby/Programmes/Full_HD/lib/main.rbw:37:in new'
        from C:/Documents and Settings/Julien/Mes documents/Ruby/Programmes/Full_HD/lib/main.rbw:37:in
<main>'
'

If I convert my mp3 files to wav and use "Song", then the quality is clearly better (but still not perfect).
What do you think about it ?

Nanaya,

P.S. : By searching in the forum, I've only discoverd that FMOD was replaced by something else (can't remember the name).
P.P.S. : I work with Netbeans IDE 6.9.1 and the lastest version of Ruby and Gosu. Even if I try without Netbeans, it doesn't work (may be stupid test, but...).
Parent - - By jlnr (dev) Date 2011-01-08 19:41
FMOD should have been kicked out, but it's still there.

The problem is that to ship MP3 decoders, you apparently needed a license when I implemented this part. I am not sure if that is still true; the FMOD licensing page clearly stated it that way.
My suggestion is to use OGG because MP3 is often broken on Linux too. Audacity is a free editor that can save as OGG.
Parent - By lol_o2 Date 2011-01-08 19:59
Good, free converter for Windows is Format Factory. It can simply convert whole directories.
Parent - - By Nanaya Date 2011-01-08 21:10
Thanks both of you.
I've asked for mp3 because it haves a "not bad" ratio quality/space taken. Since you recommand OGG, I'll use it.
Audacity is also good for editing song.
Thanks for the converter, it will be helpful, cause a lot of song are in mp3 format nowadays.

I didn't check this before ; is there a way to don't "stop" sound (in fact, this is the whole programme ; I've discoverd ruby with RPG Maker XP, when I've been testing my game, if I reduced the window, then, it having a break) when reducing the window of the programme ?
Parent - - By jlnr (dev) Date 2011-01-08 22:58
I don't pause sound on purpose. It must be Windows doing that.

I guess there must be a way around it, because Windows Media Player etc. can play sound in the background. But maybe the switch away from FMOD will just fix it.
Parent - By Nanaya Date 2011-01-08 23:32
Interesting.
With other test, it seems that the song is still playing, while there's not sound produced by the speaker.
So, I hope that your right (and the switch will be soon ^^), because it's very annoying.

Thanks,

Nanaya
Up Topic Gosu / Gosu Exchange / [Solved, somehow] Cannot load MP3 songs

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill