I am wanting to convert from an mp3 to a wave and store the result in a byte stream and send it over a network.
In read one of your previous posts and you said to convert from "PCM 44kHz Stereo to PCM 8kHZ mono. Then you can convert to A-law"
How do I do the last step? Converting to A-law?
using (NAudio.Wave.Mp3FileReader mp3Reader = new NAudio.Wave.Mp3FileReader(fileName))
using (NAudio.Wave.WaveStream pcmStream = NAudio.Wave.WaveFormatConversionStream.CreatePcmStream(mp3Reader))
using (NAudio.Wave.WaveStream alawStream = NAudio.Wave.WaveFormatConversionStream.CreatePcmStream(pcmStream))
buffer = new byte[alawStream.Length];
int byteRead = pcmStream.Read(buffer, 0, alawStream.Length);
The reason I am doing this is because I can't get NAudio to play every kind of mp3 and wave file (with varying sample rates). I need to store the byte streams of these audio files in a database and then send the stream across the network to play on a different
computer. In a different implementation I managed to play all sorts of wave files but was only able to play 44khz mp3 files. I don't know why... I would prefer to not do any converting of files if possible...
Thanks for your help!