Exemple #1
0
        /// <summary>
        /// Gets the properties of the audio.
        /// </summary>
        /// <returns>A <see cref="AudioStreamProperties"/> that contains the audio stream information.</returns>
        /// <remarks>
        /// The <see cref="Multimedia.Player"/> that owns this instance must be in the <see cref="PlayerState.Ready"/>,
        /// <see cref="PlayerState.Playing"/>, or <see cref="PlayerState.Paused"/> state.
        /// </remarks>
        /// <exception cref="ObjectDisposedException">
        /// The <see cref="Multimedia.Player"/> that this instance belongs to has been disposed of.
        /// </exception>
        /// <exception cref="InvalidOperationException">
        /// The <see cref="Multimedia.Player"/> that this instance belongs to is not in the valid state.
        /// </exception>
        /// <since_tizen> 3 </since_tizen>
        public AudioStreamProperties GetAudioProperties()
        {
            Player.ValidatePlayerState(PlayerState.Ready, PlayerState.Playing, PlayerState.Paused);

            NativePlayer.GetAudioStreamInfo(Player.Handle, out var sampleRate,
                                            out var channels, out var bitRate).
            ThrowIfFailed(Player, "Failed to get audio stream info");

            return(new AudioStreamProperties(sampleRate, channels, bitRate));
        }