(solved) Can't get volume control to work.

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
Two Dollars
Newbie
Posts: 24
Joined: Wed Oct 11, 2023 1:51 pm
Deviantart: SophomoricEnt
Contact:

(solved) Can't get volume control to work.

#1 Post by Two Dollars »

The sound files play fine, but I can't get the volume control to work.

Code: Select all

scene scene1image1
    # A residential neighborhood in New York City. It's early June and the heat
    # and humidity are already unbearable.
    play audio soundbible_cityambiance13196434 loop

scene scene2image1
    # The air conditioner grinds away.
    stop audio
    play audio soundbible_cityambiance13196434 volume 0.6 loop
    play audio danielsimon_ambianceairconditioner loop

Last edited by Two Dollars on Thu Oct 19, 2023 2:50 pm, edited 1 time in total.

User avatar
PyTom
Ren'Py Creator
Posts: 16097
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: Can't get volume control to work.

#2 Post by PyTom »

Try a much smaller number, see if it shows up. The volume clause works with amplitude, while most of the rest of Ren'Py works with dB, and so you need big changes to matter. For example, try .1 or even .01, and see if it's working.
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

Two Dollars
Newbie
Posts: 24
Joined: Wed Oct 11, 2023 1:51 pm
Deviantart: SophomoricEnt
Contact:

Re: Can't get volume control to work.

#3 Post by Two Dollars »

I tried .01 and no change in volume.

User avatar
PyTom
Ren'Py Creator
Posts: 16097
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: Can't get volume control to work.

#4 Post by PyTom »

Hm... does it work if you only play the ambiance once?

It's also quite possible that the problem here is the use of the 'audio' channel. It's intended to be used for sound effects, not for loops like this, as it allocates a channel each time it's used. For testing purposes, try using the 'music' channel for the city amieance, and see if that helps.
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

Two Dollars
Newbie
Posts: 24
Joined: Wed Oct 11, 2023 1:51 pm
Deviantart: SophomoricEnt
Contact:

Re: (solved) Can't get volume control to work.

#5 Post by Two Dollars »

Thank you! The volume command worked with the music channel.

It makes for a great transition going from inside to outside.

Post Reply

Who is online

Users browsing this forum: Bmac60506, LemonaBittera