Example #1
0
        /// <summary>
        /// Gets the current playback state of the specified track
        /// </summary>
        /// <param name="trackId">The track to retrieve the playback state for</param>
        public PlaybackState GetState(int trackId)
        {
            if (m_TrackPool.TryGet(trackId, out SoundIoAudioTrack track))
            {
                return(track.State);
            }

            return(PlaybackState.Stopped);
        }
Example #2
0
        /// <summary>
        /// Stops playback and closes the track specified by <paramref name="trackId"/>
        /// </summary>
        /// <param name="trackId">The ID of the track to close</param>
        public void CloseTrack(int trackId)
        {
            if (_trackPool.TryGet(trackId, out SoundIoAudioTrack track))
            {
                // Close and dispose of the track
                track.Close();

                // Recycle the track back into the pool
                _trackPool.Put(track);
            }
        }