Exemple #1
0
        /// <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);
        }
Exemple #2
0
 protected override void Start()
 {
     m_channel = Platform.Instance.CreateAudioPlayerChannel();
 }