Пример #1
0
 internal override void InternalPlay()
 {
     if (m_audioTrack == null)
     {
         if (!m_audioTrackCreateAttempted)
         {
             m_audioTrackCreateAttempted = true;
             m_audioTrack = AudioTrackCache.GetAudioTrack(SoundBuffer, m_isLooped);
             if (m_audioTrack != null)
             {
                 m_stopPosition = (m_isLooped ? (-1) : (SoundBuffer.SamplesCount - 1));
                 InternalSetVolume(base.Volume);
                 InternalSetPitch(base.Pitch);
                 InternalSetPan(base.Pan);
                 m_audioTrack.Play();
             }
             else if (!m_isLooped)
             {
                 Stop();
             }
         }
     }
     else
     {
         m_audioTrack.SetPlaybackHeadPosition(m_audioTrack.PlaybackHeadPosition);
         m_audioTrack.Play();
     }
 }
Пример #2
0
 internal override void InternalDispose()
 {
     if (m_audioTrack != null)
     {
         AudioTrackCache.ReturnAudioTrack(m_audioTrack);
         m_audioTrack = null;
     }
     base.InternalDispose();
 }
Пример #3
0
 internal override void InternalStop()
 {
     if (m_audioTrack != null)
     {
         AudioTrackCache.ReturnAudioTrack(m_audioTrack);
         m_audioTrack = null;
     }
     m_audioTrackCreateAttempted = false;
 }