Hi
I have a soundtrack in the game.
Is it possible to turn off the audio volume and turn on it when the jingle is over?
Thanks
Posted 16 December 2023 - 05:21 AM
Yes, if your sound track is internal files and not external
and run with the playsound command
look at playsound args, one of them is to use existing
which will play said sound from the last place it was at.
so you would
stop sound
playsound with lower volume and use the existing instance of it
then stop sound
and play it, again resuming, back to normal volume
If you feel the need to empty your wallet in my direction, i don't have any way to receive it anyways
Spend it on Hookers and Blow
Posted 16 December 2023 - 09:26 PM
"use the existing instance"
how? because PlaySound is generic.
Thanks
please read the info on playsound command, it explains it all
If you feel the need to empty your wallet in my direction, i don't have any way to receive it anyways
Spend it on Hookers and Blow
Posted 17 December 2023 - 11:26 PM
There is nothing about that in CommandReference.txt
Some code of example?
Thanks.
Not correct
PlaySound(string, int loopcount, float volume, float pan, float randompitch, int pitch, bool useexisting, bool restart, float front_rear_fade) - also allows to increase/decrease the frequency of an already playing samples, and in general to apply all the settings to an already playing sample, and to choose if to restart this playing sample from the beginning or not loopcound chooses the amount of loops volume is in 0..1 pan ranges from -1.0 (left) over 0.0 (both) to 1.0 (right) randompitch ranges from 0.0 (no randomization) to 1.0 (vary between half speed to double speed) pitch can be positive or negative and directly adds onto the standard sample frequency useexisting is 0 or 1 (if no existing/playing copy of the sound is found, then a new one is created) restart is 0 or 1 (only useful if useexisting is 1) front_rear_fade is similar to pan but fades between the front and rear speakers - so f.e. PlaySound "FlipperUp",0,0.5,-1.0,1.0,1,1,0.0 would play the sound not looped (0), at half the volume (0.5), only on left speaker (-1.0), with varying pitch (1.0), it would reuse the same channel if it is already playing (1), restarts the sample (1), and plays it on the front speakers only (0.0) StopSound(string)
If you feel the need to empty your wallet in my direction, i don't have any way to receive it anyways
Spend it on Hookers and Blow
Posted 18 December 2023 - 02:52 PM
I do that in my rolling ball routine, just check any of my tables. The code I use is this:
PlaySound("fx_ballrolling" & b), -1, ballvol, Pan(BOT(b) ), 0, ballpitch, 1, 0, AudioFade(BOT(b) )
ballvol is the volume of the sound calculated by the balls speed (speed x and speed y), so the sound is higher when the ball moves at high speed and it is lower when it is moving slower.
And it is calculated in real time ![]()
If you want to check my latest uploads then click on the image below:
Next table? A tribute table to Stern's Foo Fighters
Posted 18 December 2023 - 03:38 PM
Because you are not giving the command to use the same sound/music that it is already playing:
PlaySound(string, int loopcount, float volume, float pan, float randompitch, int pitch, bool useexisting, bool restart, float front_rear_fade)
In red are the commands you need.
In my case I use the usexisting too:
PlaySound("fx_ballrolling" & b), -1, ballvol, Pan(BOT(b) ), 0, ballpitch, 1, 0, AudioFade(BOT(b) )
If you want to change the volume of an already playing sound you need to use the useexisting, otherwise it will start a new sound. And do not use the StopSound, otherwise it will start again from the beginning.
PlaySound"Mymusic",0,myvolume,0,0,0,1,0,0
If you want to check my latest uploads then click on the image below:
Next table? A tribute table to Stern's Foo Fighters
Posted 18 December 2023 - 03:44 PM
Perfetc. Thanks, now I've understood.
Edit:
if someone needs:
Edited by boriskarloff, 18 December 2023 - 08:20 PM.
Visual Pinball →
Visual Pinball →
Help with Volume Control on Non-DMD Tables like Blackout (Williams)Started by evilforces , 22 Jul 2025 |
|
||
Visual Pinball →
VP Help Center →
Ball Roll Volume Control BuggedStarted by jw15851 , 20 Jul 2024 |
|
||
Visual Pinball →
Visual Pinball →
Audio level controls not working in VP10.7.2Started by dhpbear2 , 12 Jun 2024 |
|
||
Visual Pinball Development →
General Chat →
Help Commission to make a reskin table?Started by lastbornwolf , 09 Mar 2024 |
|
||
Visual Pinball →
VP Help Center →
VPX table sounds too loud?Started by lastbornwolf , 09 Mar 2024 |
|