Audio buffer for an audio port. Contains a float array with the specified buffer size.
상속: IProcessingItem
예제 #1
0
 /// <summary>
 /// Unmerges interlaced audio such that samples of a frame are put into audio buffers.
 /// </summary>
 /// <param name="interlaced">Interlaced.</param>
 /// <param name="audioBuffers">Audio buffers.</param>
 /// <param name="bufferSize">Buffer size.</param>
 /// <param name="bufferCount">Buffer count.</param>
 public static void DeinterlaceAudio(float[] interlaced, AudioBuffer[] audioBuffers, int bufferSize, int bufferCount)
 {
     for (int i = 0; i < bufferSize; i++) {
         for (int j = 0; j < bufferCount; j++) {
             audioBuffers [j].Audio [i] = interlaced [i * bufferCount + j];
         }
     }
 }
예제 #2
0
        /// <summary>
        /// Merges audio buffers such that all samples of a frame appear directly after each other.
        /// </summary>
        /// <returns>The audio.</returns>
        /// <param name="audioBuffers">Audio buffers.</param>
        /// <param name="bufferSize">Buffer size.</param>
        /// <param name="bufferCount">Buffer count.</param>
        public static float[] InterlaceAudio(AudioBuffer[] audioBuffers, int bufferSize, int bufferCount)
        {
            float[] interlaced = new float[bufferSize * bufferCount];

            for (int i = 0; i < bufferSize; i++) {
                for (int j = 0; j < bufferCount; j++) {
                    interlaced [i * bufferCount + j] = audioBuffers [j].Audio [i];
                }
            }
            return interlaced;
        }