ok, so my code works fine to an extent, but for some reason using multiple
'__m.PlayAudio ( )'
calls, it only switches in the game. Not the title screen.
this.PlayAudio = function ( __objData )
{
this.__objData = __objData;
this.__snd = this.__objData.sound;
this.__soundID = this.__objData.soundID;
if ( typeof ( this.__objData ) !== 'object' ) { return console.error ( 'ERROR :: { Please ensure you are using an `object` for `objectData` & try again } !' ); }
this.__soundPlaying = ( this.IsSoundPlaying ( this.__sound ) );
console.error ( 'this.__soundPlaying :: ' + this.__soundPlaying );
if ( this.IsSoundPlaying ( this.__sound ) === true ) {
this.StopAudio ( this.__sound );
this.__sound.play ( this.__soundID );
}
else {
this.__sound.play ( this.__soundID );
}
}
but to no avail.
I want it to stop the old playing sound & start the new 1.
for some reason, it’s letting the other sounds play on top of the old sound.