Change volume of sound by pressing key
j0nmark
Member Posts: 10
So... here's the first real forum post :-) Exciting. And it should be really easy to answer...
In my scene I have a controller object that plays an ogg file as soon as the scene starts. I would like to be
able to adjust the volume of the file by holding down a key to make it softer and holding down a different
key to make it louder. Eventually I'd like to test it on the iphone with UP arrow DOWN arrow actors where
you can adjust the volume by pressing either with your finger.
My overall goal is to create a musical toy / instrument. Actually the first one I'm attempting will be a toy
piano I've recorded so I guess it will be both :-) And I want to have a scene where there are 4 different
background tracks playing together that create a song (kind of like a sound bed to play on top of)... and
I'd like to allow the user to independently adjust the 4 different tracks (even taking the volume all the
way down to "eliminate" tracks if they want). While these tracks are playing (and looping) you can push
keys toplay the toy piano over it and I've restricted the notes to where whatever you play will sound
pleasing with the background track.
Anyway, I've got all my audio resources ready to go to test it out. I've already mapped 4 different toy piano
notes to the arrow keys and that is working... and I've got one of the 4 background tracks playing... I just need
to know how to map the volume of the background tracks to different keys.
Thank you for any help in advance! :-)
In my scene I have a controller object that plays an ogg file as soon as the scene starts. I would like to be
able to adjust the volume of the file by holding down a key to make it softer and holding down a different
key to make it louder. Eventually I'd like to test it on the iphone with UP arrow DOWN arrow actors where
you can adjust the volume by pressing either with your finger.
My overall goal is to create a musical toy / instrument. Actually the first one I'm attempting will be a toy
piano I've recorded so I guess it will be both :-) And I want to have a scene where there are 4 different
background tracks playing together that create a song (kind of like a sound bed to play on top of)... and
I'd like to allow the user to independently adjust the 4 different tracks (even taking the volume all the
way down to "eliminate" tracks if they want). While these tracks are playing (and looping) you can push
keys toplay the toy piano over it and I've restricted the notes to where whatever you play will sound
pleasing with the background track.
Anyway, I've got all my audio resources ready to go to test it out. I've already mapped 4 different toy piano
notes to the arrow keys and that is working... and I've got one of the 4 background tracks playing... I just need
to know how to map the volume of the background tracks to different keys.
Thank you for any help in advance! :-)
Comments
Your game idea and needs are straightforward enough. Right now the play sound behavior is really basic (as you can see). This feature is already in our cue, but won't be implemented immediately. I can suggest, though it would be only for prototyping, that you simply use your sound software to generate tracks with different volume levels and then trigger them with keypresses.
But I have added your request to the engineering team and hopefully we can integrate volume right into the play sound behavior ASAP.
Your game idea and needs are straightforward enough. Right now the play sound behavior is really basic (as you can see). A volume feature is already in our cue, but won't be implemented immediately. I can suggest, though it would be only for prototyping, that you simply use your sound software to generate tracks with different volume levels and then trigger them with keypresses. How you could do this is to have a new custom attribute called My Volume, and when a key is pressed, change it to be MyVolume + 1 or MyVolume-1, and play the corresponding sound file. I know it's less than ideal, but it's the only way to do it at the moment.
But I have added your request to the engineering team and hopefully we can integrate volume right into the play sound behavior ASAP.