Exemplo n.º 1
0
 public void Pause()
 {
     if (_theAudioStream != null)
     {
         TheAudioStream.Pause();
     }
 }
Exemplo n.º 2
0
 public void Stop()
 {
     if (_theAudioStream != null)
     {
         my_uAudioPlayer.Stop();
         TheAudioStream.Stop();
         Halt();
     }
 }
Exemplo n.º 3
0
        public void PlayPauseAudio()
        {
            if (theUrl == string.Empty)
            {
                theUrl = loadLinkFile(targetFilePath);
            }

            TheAudioStream.LoadFile(theUrl);
            TheAudioStream.Play();
#if uAudio_debug
            UnityEngine.Debug.Log(System.Environment.NewLine + "Play Song song: " + System.Environment.NewLine);
#endif
        }
Exemplo n.º 4
0
        System.Collections.IEnumerator firePlay(System.TimeSpan?OffsetStart)
        {
#if uAudio_debug
            UnityEngine.Debug.Log(System.Environment.NewLine + "1");
#endif
            yield return(new UnityEngine.WaitForSeconds(.1f));

#if uAudio_debug
            UnityEngine.Debug.Log(System.Environment.NewLine + "build clip");
#endif
            my_uAudioPlayer.myAudioSource.clip = UnityEngine.AudioClip.Create("uAudio_song", int.MaxValue,
                                                                              TheAudioStream.reader.WaveFormat.Channels,
                                                                              TheAudioStream.reader.WaveFormat.SampleRate,
                                                                              true, new UnityEngine.AudioClip.PCMReaderCallback(TheAudioStream.ReadData));

#if uAudio_debug
            UnityEngine.Debug.Log(System.Environment.NewLine + "done build clip");
#endif
            yield return(new UnityEngine.WaitForSeconds(.1f));

            TheAudioStream.callPlay(OffsetStart);
        }