Example #1
0
 public void SongEnd()
 {
     if (this.State == null)
     {
         return;
     }
     try
     {
         this.endSongTime = this.CurrentTime;
         this.myAudioSource.Stop();
         CustomSound._uAudio.Stop();
         this.myAudioSource.set_clip((AudioClip)null);
         this._loadedTarget = false;
         this.State         = (PlayBackState)0;
         try
         {
             if (this.sendPlaybackState == null)
             {
                 return;
             }
             this.sendPlaybackState((PlayBackState)0);
         }
         catch
         {
             Debug.LogWarning((object)"sendPlaybackState #897j8h2432a1q");
         }
     }
     catch
     {
         throw new Exception("Song end #7cgf87dcf7sd8csd");
     }
 }
Example #2
0
 public void SongPlay()
 {
     if (this.State == 1)
     {
         return;
     }
     this.State = (PlayBackState)1;
     try
     {
         mp3AudioClip.SongDone      = false;
         mp3AudioClip.flare_SongEnd = false;
         this.UAudio.targetFile     = (__Null)this.targetFile;
         if (Object.op_Equality((Object)this.myAudioSource.get_clip(), (Object)null))
         {
             if (this.UAudio.LoadMainOutputStream())
             {
                 long   songLength = (long)this.UAudio.get_SongLength();
                 string szErrorMs  = (string)null;
                 this.myAudioSource.set_clip(ExternalAudioClip.Load(this.targetFile, (long)this.UAudio.get_SongLength(), this.UAudio, ref szErrorMs));
                 this.CurrentTime = TimeSpan.Zero;
                 try
                 {
                     if (this.sendPlaybackState != null)
                     {
                         this.sendPlaybackState((PlayBackState)1);
                     }
                 }
                 catch
                 {
                     Debug.LogWarning((object)"theAudioStream_sendStartLoopPump #32fw46hw465h45h");
                 }
             }
             else
             {
                 this.myAudioSource.set_clip((AudioClip)null);
             }
         }
         if (Object.op_Inequality((Object)this.myAudioSource.get_clip(), (Object)null))
         {
             if (this.myAudioSource.get_isPlaying())
             {
                 return;
             }
             this.myAudioSource.Play();
         }
         else
         {
             this.State = (PlayBackState)0;
         }
     }
     catch (Exception ex)
     {
         this.State = (PlayBackState)0;
         Debug.LogWarning((object)"uAudioPlayer - Play #j356j536j356j56j");
         Debug.LogWarning((object)ex);
     }
 }