playback audio file from byte code (audio file for

2019-07-16 17:16发布

I want to playback audio file from byte code. I already have byte code for audio file. But when I playback with System.Media.SoundPlayer, I got error as "{Sound API only supports playing PCM wave files."}. My audio file format is (CCITT A-Law). Can any one who have this knowledge share with me pls??

Thanks.

2条回答
趁早两清
2楼-- · 2019-07-16 17:42

The standard G.711 tells you how to convert 8 bit A-law into 16 PCM. Here's a code snippet

查看更多
再贱就再见
3楼-- · 2019-07-16 17:44

WAV files can be encoded in many ways, usually PCM or MP3. .NET only supports PCM. Use a program to convert, this one is free (just remembed to uncheck the adware crap): http://www.nch.com.au/switch/

查看更多
登录 后发表回答