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();
}
@马克希思: - 随着ü说我一直在使用BufferedWaveProvider尝试,但我怎么能养活bufferedWaveProvider与“audioDataStream”