I have a stream of u-Law compressed PCM data I am extracting from a Camera, I need to play this out the speakers? Anybody know how? I've tried decoding the u-Law into normal WAV Data and then use SoundPlayer but it never seems to work! Always SoundPlayer only supports PCM Data?
我有一个u-Law压缩PCM数据流我从相机中提取,我需要播放扬声器吗?谁知道怎么样?我已经尝试将u-Law解码为普通的WAV数据,然后使用SoundPlayer,但它似乎永远不会起作用! SoundPlayer总是只支持PCM数据吗?
I know the sounds ok, because I have saved it to a file (using a custom createWavHeader method) and iTunes can play it.
我知道声音没问题,因为我已经将它保存到文件中(使用自定义的createWavHeader方法),iTunes可以播放它。
2 个解决方案
#1
Windows comes with an ACM codec to convert u-law to PCM. You can use NAudio and use the WaveFileReader and the WaveFormatConversionStream to get a PCM stream you can play easily.
Windows附带一个ACM编解码器,可将u-law转换为PCM。您可以使用NAudio并使用WaveFileReader和WaveFormatConversionStream来获取可以轻松播放的PCM流。
#2
Similarly, there is a freeware library lizPlay providing PCM playing capabilities. Worth considering as developers of lizPlay pay special attention to ensure there is a version that is free of patent infringement issues.
同样,有一个免费软件库lizPlay提供PCM播放功能。值得考虑的是,lizPlay的开发人员需要特别注意确保有一个没有专利侵权问题的版本。
#1
Windows comes with an ACM codec to convert u-law to PCM. You can use NAudio and use the WaveFileReader and the WaveFormatConversionStream to get a PCM stream you can play easily.
Windows附带一个ACM编解码器,可将u-law转换为PCM。您可以使用NAudio并使用WaveFileReader和WaveFormatConversionStream来获取可以轻松播放的PCM流。
#2
Similarly, there is a freeware library lizPlay providing PCM playing capabilities. Worth considering as developers of lizPlay pay special attention to ensure there is a version that is free of patent infringement issues.
同样,有一个免费软件库lizPlay提供PCM播放功能。值得考虑的是,lizPlay的开发人员需要特别注意确保有一个没有专利侵权问题的版本。