This project has moved. For the latest updates, please go here.

AcmNotPossible calling acmFormatSuggest

Oct 9, 2011 at 9:50 PM
Edited Oct 9, 2011 at 9:50 PM


as you see in the title i cant convert alaw to pcm.

the alaw format is 8000,24 bits, stereo

and i tried to convert to any  pcm format (8000, 16/24, stereo/mono) always in the SuggestPcmFormat method i get this exception.

i dont sure but i think it works form me once...

any suggestion?

here the code

            var file = File.OpenRead(fileName);
            var len = file.Length;
            var buf = new byte[len];
            file.Read(buf, 0, (int)len);
            WaveStream stream = new RawSourceWaveStream(new MemoryStream(buf), f);
            if (readerStream.WaveFormat.Encoding != WaveFormatEncoding.Pcm)
                readerStream = WaveFormatConversionStream.CreatePcmStream(readerStream); // dont work
                readerStream = new BlockAlignReductionStream(readerStream);
Oct 17, 2011 at 2:40 PM

I don't think the Windows provided ACM converters can do 24 bit audio. However, there is some 24 bit audio support in the very latest NAudio source code you can experiment with (see the NAudioDemo app which can play 24 bit audio for a code sample)