Quantcast
Channel: NAudio
Viewing all articles
Browse latest Browse all 5831

New Post: How to play an a-law-encoded network stream

$
0
0

Hi there,

I'm new to NAudio and have problems while trying to play an a-law encoded network stream. My approach goes like this:

RawSourceWaveStream myALawStream = new RawSourceWaveStream(networkStream, WaveFormat.CreateALawFormat(8000, 1));
WaveStream pcmStream = WaveFormatConversionStream.CreatePcmStream(myALawStream);
WaveOut myWaveOut = new WaveOut();
myWaveOut.Init(pcmStream);
myWaveOut.Play();


The WaveOut should play while data is available and be silent when not. But how is the networkStream to be created? I want to fill it with A-law encoded bytes as they come in from the network. Do I have to implement a new class that derives from WaveStream or am I missing something.

 

Thanks,

Norbert


Viewing all articles
Browse latest Browse all 5831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>