/// <summary> /// Get the entire audio managed by this instance as an AudioSegment /// </summary> /// <returns>The audio segment containing all audio data and a stream to access that data.</returns> public AudioSegment GetEntireAudio() { byte[] dataCopy = (byte[])AudioData.Clone(); //Make copy of audio data /*Calc audio length in milliseconds */ long bitRate = REQ_SAMPLE_RATE * REQ_BITS_PER_SAMPLE; long bytesPerSecond = bitRate / 8L; long audioLengthMS = AudioData.Length * 1000L / bytesPerSecond; return(new AudioSegment(dataCopy, 0, audioLengthMS)); }