public NativeAudioController Play(NativeAudio.PlayOptions playOptions) { if (isUnloaded) { throw new System.Exception("You cannot play an unloaded NativeAudio."); } int playedSourceIndex = -1; #if UNITY_IOS if (prepared) { //This is using source index. It means we have already loaded our sound to that source with Prepare. NativeAudio._PlayAudioWithSourceCycle(this.prepareIndex, playOptions); playedSourceIndex = this.prepareIndex; } else { //-1 audioPlayerIndex results in round-robin, 0~15 results in hard-specifying the track. playedSourceIndex = NativeAudio._PlayAudio(this.NextIndex, playOptions.audioPlayerIndex, playOptions); } prepared = false; #elif UNITY_ANDROID playedSourceIndex = NativeAudio.playAudio(this.NextIndex, playOptions); #endif return(new NativeAudioController(playedSourceIndex)); }