playback audio file from byte code (audio file format is CCITT A-Law)

送分小仙女□ 提交于 2020-01-04 13:40:05

问题


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.


回答1:


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




回答2:


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/



来源:https://stackoverflow.com/questions/4070294/playback-audio-file-from-byte-code-audio-file-format-is-ccitt-a-law

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!