[Solved] (workaround) How to play a sound on "notify" ?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
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.
Post Reply
Message
Author
User avatar
Chekhov
Regular
Posts: 113
Joined: Tue Jun 26, 2018 9:19 am
Projects: Pluton
Contact:

[Solved] (workaround) How to play a sound on "notify" ?

#1 Post by Chekhov »

I've been trying to get a sound to play upon when a notify is called.

I've read here: viewtopic.php?f=8&t=13316

That this is supposed to do exactly that from screen language:

Code: Select all

on "replace" action Play("music", "Gallery.mp3")
And here's how I tried to implement it:

Code: Select all

screen notify(message):
    on "replace" action Play("sound", "sound/good.wav")
    zorder 100
    style_prefix "notify"
 
    frame at notify_appear:
        text "[message!tq]"
        

    timer 5.25 action Hide('notify')
Yes the file is actually there, and the volume is actually on.
Last edited by Chekhov on Sat Mar 30, 2019 8:15 am, edited 2 times in total.

User avatar
Matalla
Veteran
Posts: 202
Joined: Wed Mar 06, 2019 6:22 pm
Completed: Max Power and the Egyptian Beetle Case, The Candidate, The Last Hope, El cajón del viejo escritorio, Clementina y la luna roja, Caught in Orbit, Dirty Business Ep 0, Medianoche de nuevo, The Lost Smile
itch: matalla-interactive
Location: Spain
Contact:

Re: How to play a sound on "notify" ?

#2 Post by Matalla »

Funny... I have been trying to do the same, with similar problems. Finally I cheated a little...

Code: Select all

screen notify(message):
    
    zorder 100
    style_prefix "notify"
    
    frame at notify_appear:
        text "[message!tq]"
        
    timer 0.01 action Play("sound", "sounds/notifybeepchime.mp3") # Nice stupid workaround, isn't it?
    timer 4.25 action Hide('notify')
Comunidad Ren'Py en español (Discord)
Honest Critique

User avatar
Chekhov
Regular
Posts: 113
Joined: Tue Jun 26, 2018 9:19 am
Projects: Pluton
Contact:

Re: How to play a sound on "notify" ?

#3 Post by Chekhov »

It may be dirty, but it is like manna from the sky. Thank you, Matalla. I was spending way too much time on this.

User avatar
IrinaLazareva
Veteran
Posts: 399
Joined: Wed Jun 08, 2016 1:49 pm
Projects: Legacy
Organization: SunShI
Location: St.Petersburg, Russia
Contact:

Re: [Solved] (workaround) How to play a sound on "notify" ?

#4 Post by IrinaLazareva »

also you can use:

Code: Select all

on "show" action Play("music", "Gallery.mp3")
instead of
on 'replace'

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]