Eliminate "crackle" from looped sound callback?

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
novalyssa
Newbie
Posts: 10
Joined: Fri Jul 03, 2015 4:40 pm
Contact:

Eliminate "crackle" from looped sound callback?

#1 Post by novalyssa »

Hi there! I was wondering if any of you had a suggestion for the following predicament:

I'm using a sound file that beeps continuously as text is shown (as described here), and it works beautifully, but unless I use just the right amount of characters in a text segment there's this jarring "crackle" sound at the end of it. I think what might be happening is that the sound is starting to replay, but it gets abruptly cut off?

I've tinkered around with the fadeout, but that doesn't seem to help (or I'm just an idiot and am using it wrong). Does anyone know of a way to prevent this kind of thing?

Here is what I'm working with:

Code: Select all

init python:
    config.default_text_cps = 20   # no $-sign if this line inside an init python block

    def beep1(event, **kwargs):
        if event == "show":
            renpy.music.play("beep2.wav", channel="sound", loop="true", fadeout =1, fadein=0, tight=False)
        elif event == "slow_done" or event == "end":
            renpy.music.stop(channel="sound") 

init:
    $ x = Character("", callback=beep1)
    $ config.default_text_cps = 20    # required $-sign if this line inside an init block
    $ pname = ""
    $ n = DynamicCharacter("pname", color=(192, 64, 64, 255))

image white = "#ffffff"

label start:

    scene white
    x "So tell me, stranger, what is your first name?"
    $ player_name = renpy.input("")
    $ player_name = player_name.strip()
    if player_name == "":
        $ player_name="Jane"
    x "And your surname?"
    $ player_surname = renpy.input("")
    $ player_surname = player_surname.strip()
    if player_surname == "":
        $ player_surname="Smith"
    x "Take a peek into that mirror over there."
    x " . . . "
    x "You could do with a bit of primping."
    call screen character_customization_screen
Thank you in advance! ^-^

User avatar
Jae
Regular
Posts: 192
Joined: Sun Sep 13, 2015 5:41 pm
Projects: Pokémon Academy Life
Location: New York, NY
Contact:

Re: Eliminate "crackle" from looped sound callback?

#2 Post by Jae »


novalyssa
Newbie
Posts: 10
Joined: Fri Jul 03, 2015 4:40 pm
Contact:

Re: Eliminate "crackle" from looped sound callback?

#3 Post by novalyssa »

Thank you very much for the suggestion! I'm heading out the door right now so I can't test it until later this afternoon; I'll edit this post and let you know if I was able to apply it to this situation.

EDIT: I watched the video, Jae, and although I've bookmarked it for future reference (it was a very useful tutorial!), I don't really see a way I can apply it to this particular problem. The audio file I'm using is a single "beep" noise that is being looped only when a character has dialogue, as opposed to a song being looped continuously in the background. If I'm overlooking/misinterpreting something in the explanation, please do let me know!

I'm still troubleshooting on my own, but if anyone has any further insight, I'd really appreciate it.

(Thank you again for trying to help me out, Jae!)

Blake337
Newbie
Posts: 24
Joined: Fri Sep 25, 2015 6:37 am
Skype: blake_mj
Contact:

Re: Eliminate "crackle" from looped sound callback?

#4 Post by Blake337 »

novalyssa wrote: Mon Oct 12, 2015 12:28 pm
Thank you very much for the suggestion! I'm heading out the door right now so I can't test it until later this afternoon; I'll edit this post and let you know if I was able to apply it to this situation.

EDIT: I watched the video, Jae, and although I've bookmarked it for future reference (it was a very useful tutorial!), I don't really see a way I can apply it to this particular problem. The audio file I'm using is a single "beep" noise that is being looped only when a character has dialogue, as opposed to a song being looped continuously in the background. If I'm overlooking/misinterpreting something in the explanation, please do let me know!

I'm still troubleshooting on my own, but if anyone has any further insight, I'd really appreciate it.

(Thank you again for trying to help me out, Jae!)
I know this is 5 years old, but, could you figure out how to solve it? I'm having the same issue...

User avatar
apexchimps
Regular
Posts: 29
Joined: Mon Jan 25, 2016 6:12 pm
Completed: Detective Max, Nick's Night Out!, Arthur & Susan: Almost Detectives
Projects: Arthur & Susan: Almost Detectives
Contact:

Re: Eliminate "crackle" from looped sound callback?

#5 Post by apexchimps »

Hi! I just came across this exact same issue. I'm not sure why is happening but I managed to solve it by doing a fadeout of 0.1 seconds in the callback, in the sound.stop. If anyone has a better solution I would be glad to read it!

Post Reply

Who is online

Users browsing this forum: Google [Bot]