Can't Register Audio Channel [Solved]
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.
Can't Register Audio Channel [Solved]
I'm using the "renpy.music.register_channel(name, mixer=None, loop=None, stop_on_mute=True, tight=False, file_prefix='', file_suffix='', buffer_queue=True)" function from the documentation. I figured that creating a separate audio channel will let me play two sound effects at the same time. But...I don't know where to put it. I put it in the scripts file and in the options file and they both gave me errors when I did that. It says that the "sound2" (which I named my channel) is not defined.
If someone could help me out I'd really appreciate it. (ಥ_ಥ)
If someone could help me out I'd really appreciate it. (ಥ_ಥ)
Last edited by Angelee on Sun Jan 25, 2015 10:36 pm, edited 1 time in total.
- trooper6
- Lemma-Class Veteran
- Posts: 3712
- Joined: Sat Jul 09, 2011 10:33 pm
- Projects: A Close Shave
- Location: Medford, MA
- Contact:
Re: Can't Register Audio Channel
I'm pretty sure you can put the declarations in any file since Renpy treats all individual files as one big file.
It should however be in an init block and a python block.
This is what I have in my code:
It works for me...so what exactly did you put in your code?
It should however be in an init block and a python block.
This is what I have in my code:
Code: Select all
init -1 python:
renpy.music.register_channel("TockBG", mixer= "sfx", loop=True)
renpy.music.register_channel("ChimeBG", mixer= "sfx", loop=False, tight=True)
renpy.music.register_channel("Alarm", mixer= "sfx", loop=False, tight=True) A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?) Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?) Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978
Re: Can't Register Audio Channel
EDIT: Wait, I think I see the problem once I compare our scripts. Let me try something and I'll post the results.
EDIT: Yep, thanks a lot, trooper6! That did the trick.
The problem was that I didn't put the channel name in quotes.
I put:
renpy.music.register_channel(sound2, mixer="sfx", loop=False, stop_on_mute=True, tight=True, buffer_queue=True)
instead of:
renpy.music.register_channel("sound2", mixer="sfx", loop=False, stop_on_mute=True, tight=True, buffer_queue=True)
Such a simple thing but I was scratching my head for hours! Maybe I'm not cut out for programming, lol. (─‿‿─)
Thanks again!
EDIT: Yep, thanks a lot, trooper6! That did the trick.
I put:
renpy.music.register_channel(sound2, mixer="sfx", loop=False, stop_on_mute=True, tight=True, buffer_queue=True)
instead of:
renpy.music.register_channel("sound2", mixer="sfx", loop=False, stop_on_mute=True, tight=True, buffer_queue=True)
Such a simple thing but I was scratching my head for hours! Maybe I'm not cut out for programming, lol. (─‿‿─)
Thanks again!
Last edited by Angelee on Sun Jan 25, 2015 7:42 pm, edited 1 time in total.
Re: Can't Register Audio Channel
Put sound2 in quotes. Yeah, I know the documentation isn't super helpful at pointing out when things should be strings or not. 
Re: Can't Register Audio Channel
Haha, thanks! I figured it out a second ago. Now I feel so dumb.philat wrote:Put sound2 in quotes. Yeah, I know the documentation isn't super helpful at pointing out when things should be strings or not.
- trooper6
- Lemma-Class Veteran
- Posts: 3712
- Joined: Sat Jul 09, 2011 10:33 pm
- Projects: A Close Shave
- Location: Medford, MA
- Contact:
Re: Can't Register Audio Channel
Glad I could help! Don't forget to edit the title of your first post to included [Solved]
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?) Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?) Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978
Who is online
Users browsing this forum: Bing [Bot]
