/// <summary> /// Creates an audio player channel. /// </summary> /// <returns></returns> public IAudioPlayerChannel CreateAudioPlayerChannel() { IAudioPlayerChannel channel = null; #if IOS_NATIVE if (Application.isMobilePlatform && EnableBackgroundAudio) { // TODO: the native channels need to be able to support streaming // loading, otherwise they block for too long. channel = new IOSAudioPlayerChannel(); } #endif #if ANDROID_NATIVE if (Application.isMobilePlatform && EnableBackgroundAudio) { channel = new OpenSLAudioPlayerChannel(); } #endif if (channel == null) { channel = gameObject.AddComponent <UnityAudioPlayerChannel>(); } return(channel); }
protected override void Start() { m_channel = Platform.Instance.CreateAudioPlayerChannel(); }