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 :- As u said I have tried using BufferedWaveProvider but how can i feed the bufferedWaveProvider with "audioDataStream "
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…