Ren'Py How do you guys play audio files?

CaramelCowboy

Member
Game Developer
Jun 24, 2020
440
2,512
Hi guys, I'm trying to add sound to my game so i'm using a random test mp3 file that plays on windows but it just doesn't play ingame. No errors. Just doesn't play.
What software do you use to get mp3 files? I'm wondering if Renpy doesn't like mine because i converted it from some random online mp3 converter site

Edit : .ogg files seem to work. Should I just stick with that?
 

Penfold Mole

Engaged Member
Respected User
May 22, 2017
2,989
6,998
You may be missing an mp3 decoder in your system. Or the mp3 file you are testing just isn't a real mp3.
Playing a media file in a player that has its own decoders built in or included doesn't mean that your Windows itself has a decoder installed for it.
Sometimes people also mess up their system media codecs by installing a bunch of conflicting codecs from some codec pack.

If you want to create a proper mp3 audio file, get Audacity for example. It's a bit much to just convert an audio file, but I'm sure you'll find it useful at some point when you want to edit or record and edit your own audio files.
 
Last edited:
  • Like
Reactions: CaramelCowboy

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,368
15,283
Playing a media file in a player that has its own decoders built in or included doesn't mean that your Windows itself has a decoder installed for it.
Nor that Ren'py will recognize the codec and accept to play it. This is especially true for MP3, that isn't a codec defined strongly enough. What mean that depending of the software used to encoded it, the result will not necessarily be constant, and some decoders will fail to read them.
This specifically apply to Ren'py, that implement audio as an addition and not as a main feature. Therefore it's more pron to not know how to deal with too exotic way to encode MP3.


If you want to create a proper mp3 audio file, get Audacity for example.
Since we are talking about Ren'py, converting in Ogg Vorbis is the better way to be sure that the file will be read correctly.