且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何播放mp3/mp4文件.

更新时间:2023-01-18 14:03:49

MP3和其他格式的播放需要解码音频,然后将解码后的数据推送到声卡.应用程序开发人员太多了.

我建议您可以使用一些现有的SDK来执行此操作.

1.在Windows上,您可以使用WMPSDK 来播放其他主要格式(前提是系统上提供了该格式的编解码器)

2.您可以使用DirectX 播放许多格式.

3.第二个是libvlc.我没有亲自使用(我打算),但似乎也可以用于音频播放.也有一些托管包装器.
The playback of MP3 and other format need decoding the audio and then pushing the decoded data to the sound card. that is too much of an application developer.

I suggest you can use some of the existing SDKs for doing this.

1. On windows you can use the WMPSDK which will take care of playing other major formats (provided the codec for the format is available on the system)

2. you can use DirectX to play a lot of formats.

3. The 2rd one is libvlc. I have not used it personally(i am planning to) but it seems it could also be used for audio playback. there are some managed wrappers available for it too.