Hello. I've been having a bit of trouble adding sound effects.
For instance, when I have a code like this:
play sound "sound.ogg"
"Hello world"
return
Then the sound effect will work perfectly fine. However, when I have a code that looks like this:
play sound "sound.ogg"
e "Hello world"
return
The sound effect won't play at all. Is there a way to fix this? Thanks!
How to allow sound effects to play when a defined character is speaking dialogue?
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
- isobellesophia
- Miko-Class Veteran
- Posts: 979
- Joined: Mon Jan 07, 2019 2:55 am
- Completed: None
- Projects: Maddox and Friends! (AI Teacher friend), Friendly Universities! (Soon)
- Organization: Friendly Teachers series
- Deviantart: SophBelle
- itch: Child Creation
- Location: Philippines, Mindanao
- Contact:
Re: How to allow sound effects to play when a defined character is speaking dialogue?
Can you show the code?
For me, anything works, i did that as defined dialogue.
There might be something in your script.
For me, anything works, i did that as defined dialogue.
There might be something in your script.
- papillon
- Arbiter of the Internets
- Posts: 4107
- Joined: Tue Aug 26, 2003 4:37 am
- Completed: lots; see website!
- Projects: something mysterious involving yuri, usually
- Organization: Hanako Games
- Tumblr: hanakogames
- Contact:
Re: How to allow sound effects to play when a defined character is speaking dialogue?
Sound effects normally play while characters are speaking. No special code is needed to cause that.
Usually a sound failing to play means that either you have the filename wrong OR some other sound is playing which is overriding it. (Or your sound is off.)
Do you have a typing-text sound effect set up that makes a noise while dialog appears?
Usually a sound failing to play means that either you have the filename wrong OR some other sound is playing which is overriding it. (Or your sound is off.)
Do you have a typing-text sound effect set up that makes a noise while dialog appears?
- isobellesophia
- Miko-Class Veteran
- Posts: 979
- Joined: Mon Jan 07, 2019 2:55 am
- Completed: None
- Projects: Maddox and Friends! (AI Teacher friend), Friendly Universities! (Soon)
- Organization: Friendly Teachers series
- Deviantart: SophBelle
- itch: Child Creation
- Location: Philippines, Mindanao
- Contact:
Re: How to allow sound effects to play when a defined character is speaking dialogue?
I think it will obviously cause a error from the start when putting it in a wrong file, i used a sfx folder to put my sound effects there,
You should make a folder for it, and then list it like this.
OR, as papillon said, you may used a file that wont play when opening that file, which is only need an mp3 or ogg file that can be played. Like a icon of blue note can be played, while the empty white file wont.
You can use Audacity, and then export it in ogg file.
You should make a folder for it, and then list it like this.
Code: Select all
play sound "sfx/sound.ogg"
You can use Audacity, and then export it in ogg file.
Re: How to allow sound effects to play when a defined character is speaking dialogue?
Ah yeah, I figured it out. It's because I have each character with a callback sound when their dialogue is typed out. But I managed to fix the problem by defining another audio channel. I just did:
init python:
renpy.music.register_channel("sfx", True)
and when I needed to use the sound:
e "insert sentence here"
play sfx "crash_sfx.ogg" noloop
Thanks for replying though! I really appreciate it. ^_^
init python:
renpy.music.register_channel("sfx", True)
and when I needed to use the sound:
e "insert sentence here"
play sfx "crash_sfx.ogg" noloop
Thanks for replying though! I really appreciate it. ^_^
Who is online
Users browsing this forum: Exiscoming, Google [Bot]