How to make a beeping noise while text is being spelled out

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
Alphonse
Regular
Posts: 105
Joined: Tue Aug 26, 2008 7:32 pm
Contact:

How to make a beeping noise while text is being spelled out

#1 Post by Alphonse »

Like the title says. Is it possible to have little beeps as the text is being written out on the screen? You know what I mean. Like in Pokemon (I believe) or Ace Attorney. It always felt...empty...without them. I hope you guys understand what I'm talking about. Alternately, I've heard it as typewriter noises while the text is being spelled out.

Wow, I probably sounded stupid when I just said that. But I'm not sure how else to describe it.

Tranquility
Newbie
Posts: 14
Joined: Tue May 26, 2009 3:10 pm
Projects: Unnamed Project
Contact:

Re: How to make a beeping noise while text is being spelled out

#2 Post by Tranquility »

Couldn't you just use something like

Code: Select all

play sound "file.ogg"
before said dialogue, and then

Code: Select all

stop sound
after it is complete, I don't imagine you want it to be playing constantly, however if that is the case maybe looping a 3 second clip throughout the entire script would suffice... to be honest it sounds quite annoying, either way, though.
Image

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: How to make a beeping noise while text is being spelled out

#3 Post by PyTom »

Something like:

Code: Select all

init python:
    def callback(event, **kwargs):
        if event == "show":
            renpy.music.play("godawful-beeping-noise.ogg", channel="sound")
        elif event == "slow_done" or event == "end":
            renpy.music.stop(channel="sound")

    pw = Character("Generic Lawyer Guy", callback=callback)


label start:

    pw "Why do people always wind up dead in these games?"

    pw "Maybe it's because these beeps are driving people insane!"
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
rinrin
Veteran
Posts: 211
Joined: Thu Apr 16, 2009 9:18 am
Completed: Several.
Projects: Several.
Contact:

Re: How to make a beeping noise while text is being spelled out

#4 Post by rinrin »

I was super happy to see this thread since implementing text sounds is something I wanted to ask about anyway... but for some reason, the code PyTom kindly posted here doesn't work for me :(

I just:
1. copied the code into a New Project,
2. placed the sound file in the game directory and changed godawful-beeping-noise.ogg to reflect the actual filename
3. changed the config.default_text_cps in options.rpy to 30 (since at 0, it just displays text without "printing it out")
and it doesn't work (I don't hear any sound while the text is being written).

Did I miss something / is there anything else I should have done?

JQuartz
Eileen-Class Veteran
Posts: 1265
Joined: Fri Aug 31, 2007 7:02 am
Projects: 0 completed game. Still haven't made any meaningfully completed games...
Contact:

Re: How to make a beeping noise while text is being spelled out

#5 Post by JQuartz »

rinrin wrote:Did I miss something / is there anything else I should have done?
The channel="sound" is a relatively new feature. If you're not using the latest(?) Renpy then it won't work. You can try using a number like so:

Code: Select all

def callback(event, **kwargs):
        if event == "show":
            renpy.music.play("godawful-beeping-noise.ogg", channel=7)
        elif event == "slow_done" or event == "end":
            renpy.music.stop(channel="sound")
I suspect somebody is stealing my internet identity so don't believe everything I tell you via messages. I don't post or send messages anymore so don't believe anything I tell you via messages or posts.

User avatar
rinrin
Veteran
Posts: 211
Joined: Thu Apr 16, 2009 9:18 am
Completed: Several.
Projects: Several.
Contact:

Re: How to make a beeping noise while text is being spelled out

#6 Post by rinrin »

I changed channel="sound" to channel=7 and can actually hear the sound now, but the problem is, it doesn't stop when the text does. It just keeps beeping on and on, until the game ends.

So I suppose I should upgrade to the latest Renpy?
(I'm a bit worried whether my 1/3 finished game will still work with the new version? I'm currently using 6.8.1a)

JQuartz
Eileen-Class Veteran
Posts: 1265
Joined: Fri Aug 31, 2007 7:02 am
Projects: 0 completed game. Still haven't made any meaningfully completed games...
Contact:

Re: How to make a beeping noise while text is being spelled out

#7 Post by JQuartz »

rinrin wrote:I changed channel="sound" to channel=7 and can actually hear the sound now, but the problem is, it doesn't stop when the text does. It just keeps beeping on and on, until the game ends.
Oh, I forgot the code to stop music also uses channel=="sound". So you have to change that to 7 as well like so:

Code: Select all

def callback(event, **kwargs):
        if event == "show":
            renpy.music.play("godawful-beeping-noise.ogg", channel=7)
        elif event == "slow_done" or event == "end":
            renpy.music.stop(channel=7)
rinrin wrote:So I suppose I should upgrade to the latest Renpy?(I'm a bit worried whether my 1/3 finished game will still work with the new version? I'm currently using 6.8.1a)
I think it'll work.
I suspect somebody is stealing my internet identity so don't believe everything I tell you via messages. I don't post or send messages anymore so don't believe anything I tell you via messages or posts.

User avatar
rinrin
Veteran
Posts: 211
Joined: Thu Apr 16, 2009 9:18 am
Completed: Several.
Projects: Several.
Contact:

Re: How to make a beeping noise while text is being spelled out

#8 Post by rinrin »

It works now!
Thank you!! :D

Alphonse
Regular
Posts: 105
Joined: Tue Aug 26, 2008 7:32 pm
Contact:

Re: How to make a beeping noise while text is being spelled out

#9 Post by Alphonse »

Thank you for your help, guys. I've been a little too busy for the last couple of days to come check on this thread, so sorry! I'll try your solutions. Again, thanks for taking time out to do this and what not. *touched*

Jo'ogn
Veteran
Posts: 398
Joined: Sat Jul 12, 2008 1:31 pm
Projects: Kassiopeia [iVN]
Location: Deutschland
Contact:

Re: How to make a beeping noise while text is being spelled out

#10 Post by Jo'ogn »

PyTom wrote:

Code: Select all

init python:
    def callback(event, **kwargs):
        if event == "show":
            renpy.music.play("godawful-beeping-noise.ogg", channel="sound")
        elif event == "slow_done" or event == "end":
            renpy.music.stop(channel="sound")

    pw = Character("Generic Lawyer Guy", callback=callback)

label start:

    pw "Why do people always wind up dead in these games?"
I tried this out with a very short looped SFX. It works, but has some side effects. Pressing "H" during beeping will suspend "end" event. i.e. the beeping will continue. Same might happen if jumping into game menu by pressing ESC, or going backwards (rollback).

Skipping, or the unpredictable lenth of a line might cause a 'click', or crack(le) at the end of a line as the beep sound is just cut off. Haven't tried a short fade out, yet.
Audio Plays: [original] The White Feathers Directive - [Star Wars] Through Flame and Shadow
Ren'Py: Kassiopeia [very interactive VN] work in progress - looking for proof reader english

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]