private void startMusic ( float pitch , float volume , boolean loop ) { if ( currentMusic != null ) { currentMusic . stop ( ) ; currentMusic . fireMusicSwapped ( this ) ; } currentMusic = this ; if ( volume < 0.0f ) volume = 0.0f ; if ( volume > 1.0f ) volume = 1.0f ; sound . playAsMusic ( pitch , volume , loop ) ; playing = true ; setVolume ( volume ) ; if ( requiredPosition != - 1 ) { setPosition ( requiredPosition ) ; } }
play or loop the music at a given pitch and volume