示例#1
0
        /// <summary>
        /// Plays the specified music track.
        /// If another track is currently playing it will be stopped.
        /// </summary>
        /// <param name="path">Audio file path in Resources folder</param>
        /// <param name="options">Audio options</param>
        public static void Play(string path, AudioOptions options = null)
        {
            if (_audioPlayer.IsPlaying(path))
            {
                return;
            }

            _audioPlayer.StopAll();
            _audioPlayer.Play(path, options);
        }
示例#2
0
 /// <summary>
 /// Stops all audio files.
 /// </summary>
 public static void StopAll()
 {
     _audioPlayer.StopAll();
 }