Example #1
0
        /// <summary>
        /// Stops the audio recording and releases the used audio recording source.
        /// </summary>
        /// <returns>
        /// <see langword="true"/>, if the audio recording stopped sucessful; <see langword="false"/> otherwise.
        /// </returns>
        public bool StopRecording()
        {
            if (!IsRecording())
            {
                return(false);
            }

            if (audioSource.StopUsingForAudioRecording(ActivityId))
            {
                audioSource = null;
                return(true);
            }

            return(false);
        }
        /// <summary>
        /// Stops the audio recording and releases the used audio recording source.
        /// </summary>
        /// <returns>
        /// <see langword="true"/>, if the audio recording stopped sucessful; <see langword="false"/> otherwise.
        /// </returns>
        public bool StopRecording()
        {
            if (!IsRecording())
            {
                return false;
            }

            if (audioSource.StopUsingForAudioRecording(ActivityId))
            {
                audioSource = null;
                return true;
            }

            return false;
        }
Example #3
0
        /// <summary>
        /// Start the audio recording using the audio source device.
        /// </summary>
        /// <param name="audioSource">
        /// The device providing the audio signal to be recorded.
        /// </param>
        /// <returns>
        /// <see langword="true"/>, if the audio recording started sucessful; <see langword="false"/> otherwise.
        /// </returns>
        public bool StartRecording(IAudioRecordingSource audioSource)
        {
            if (audioSource == null)
            {
                throw new ArgumentNullException(nameof(audioSource));
            }

            if (audioSource.UseForAudioRecording(ActivityId))
            {
                this.audioSource = audioSource;
                return(true);
            }

            return(false);
        }
        /// <summary>
        /// Start the audio recording using the audio source device.
        /// </summary>
        /// <param name="audioSource">
        /// The device providing the audio signal to be recorded.
        /// </param>
        /// <returns>
        /// <see langword="true"/>, if the audio recording started sucessful; <see langword="false"/> otherwise.
        /// </returns>
        public bool StartRecording(IAudioRecordingSource audioSource)
        {
            if (audioSource == null)
            {
                throw new ArgumentNullException(nameof(audioSource));
            }

            if (audioSource.UseForAudioRecording(ActivityId))
            {
                this.audioSource = audioSource;
                return true;
            }

            return false;
        }