Sound Channels in Renpy with Characters Voices


This is going to be a cont. of the Character Callback tutorial I wrote some long time ago. Because I discovered how to use the Sound Channels in Renpy. 

Just happens that renpy.sound is a clone of renpy.music but in the sound channel. What I didn't knew is the fact you can change the channel in which the sound is played at. As per documentation:

renpy.music.play(filenames, channel=u'music', loop=None, fadeout=None, synchro_start=False, fadein=0, tight=None, if_changed=False, relative_volume=1.0)

That's the definition with the documentation, you can see channel = 'music'. So, if you run: 

renpy.music.play("audiofile.mp3") 

Is going to run in the channel music. But, if you want to run in the channel "voice", you do this:

renpy.music.play("audiofile.mp3", channel="voice") 

And now the file is going to run in the channel voice. This is good when you need to run sound effects and voices at the same time, which was a situation I just find myself in it while doing the current project. 

Now, if you need, for some reason, more than 3 channels, you can create one. 

renpy.music.register_channel("bleeps")

With that we just created the channel bleeps, and its going to have the config for music (Music volume and so forth). If you want that with a different config than music, you can add a mixer as per documentation

Anyhow, to use this new channel while using the renpy object you just have to change the name of the channel, but while using the play statement during dialog, you can do this

play music "audiofile.mp3" # Music Channel
play sound "audiofile.mp3" # Sound Channel
play voice "audiofile.mp3" # Voice Channel
play bleeps "audiofile.mp3" # Bleeps Channel

Here we go

Get Sam and Max in Psychic Directive and Lighting Soldier

Leave a comment

Log in with itch.io to leave a comment.