Exemple #1
0
        /// <summary>
        /// Updates this audio frame with the specified audio data.
        /// (<see cref="AudioData.NumSamples"/> and <see cref="AudioData.NumChannels"/>
        /// should match the respective values for this instance!).
        /// </summary>
        /// <param name="audioData">The audio data.</param>
        public void UpdateFromAudioData(AudioData audioData)
        {
            if (SampleFormat != SampleFormat.SingleP)
            {
                throw new Exception("Cannot update data of an AudioFrame with a SampleFormat not equal to SampleFormat.SingleP");
            }

            for (uint ch = 0; ch < NumChannels; ch++)
            {
                var newData  = audioData.GetChannelData(ch);
                var currData = GetChannelData(ch);

                newData.CopyTo(currData);
            }
        }