private void receiveAudio(object sender)
{
IPEndPoint senderEP = new IPEndPoint(IPAddress.Any, 0);
MemoryStream audioDataStream;
BufferedWaveProvider bufferedWaveProvider;
//RawSourceWaveStream receivedRawAudioData;
byte[] receivedAudioData;
waveOutStream = new WaveOut();
while (IsAudioTransferActive)
{
receivedAudioData = audioUDPClient.Receive(ref senderEP);
audioDataStream = new MemoryStream(receivedAudioData);
//receivedRawAudioData = new RawSourceWaveStream(audioDataStream, audioFormat);
bufferedWaveProvider = new BufferedWaveProvider(audioFormat);
//How can I feed "audioDataStream " to "bufferedWaveProvider "
waveOutStream.Init(bufferedWaveProvider);
waveOutStream.Play();
}
waveOutStream.Stop();
waveOutStream.Dispose();
}
@Mark Heath:-正如你所说,我尝试过使用 BufferedWaveProvider 但我如何才能为 bufferedWaveProvider 提供“audioDataStream”