public void setVolume ( float volume ) { // Save this in case this audio source is not being played yet mVolume = volume ; if ( isPlaying ( ) && ( getSourceId ( ) != GvrAudioEngine . INVALID_ID ) ) { // This will actually work only if the sound file is being played mAudioListener . getAudioEngine ( ) . setSoundVolume ( getSourceId ( ) , getVolume ( ) ) ; } }
Changes the volume of an existing sound .