Not logged inGosu Forums
Forum back to libgosu.org Help Search Register Login
Up Topic Gosu / Gosu Exchange / Sound problem in game developed in 2017 with current version
- - By barrykad3 Date 2022-03-31 15:20
Hello!

In 2017 I developed a game using ruby and gosu, it played perfectly. Recently I wanted to update my portfolio with this project, but when I run it I get the following error message:

/var/lib/gems/2.7.0/gems/gosu-1.4.3/lib/gosu/compat.rb:116:in `initialize': Could not parse audio file sounds/game.wav: Sound format unsupported (RuntimeError)

I've checked the game.wav file, it's working fine.

The code fragment where I load the sound is this one:
    @font = Gosu::Font.new(30)
    @game_music = Gosu::Song.new('sounds/game.wav')
    @game_music.play(true)
    @collide_sound = Gosu::Sample.new('sounds/collide.wav')
    @death_sound = Gosu::Sample.new('sounds/death1.wav')
    @hurt_sound = Gosu::Sample.new('sounds/hurt.wav')
    @player_death_sound = Gosu::Sample.new('sounds/player_death.wav')
    @throw_sound = Gosu::Sample.new('sounds/throw.wav')

I'm aware gosu has been updated a lot since 2017, but I can't find any changes related to sound.

Any tips on how to fix this?

Thank you.
Parent - By jlnr (dev) Date 2022-04-09 13:15
Hey, I am not sure why I didn't receive an email for this new post. This issue has been discussed a bit on the Discord, and sound is actually one of the areas that have changed the most recently. Gosu now uses SDL_sound for loading audio files (as opposed to a merry mix of different libraries), and mojoAL for playback instead of a different OpenAL implementation per operating system.

Can you please share the WAV file? I am curious what kind of WAV format/encoding broke.
Up Topic Gosu / Gosu Exchange / Sound problem in game developed in 2017 with current version

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill