开发者

How to output MP3s to a sound card

I'm trying to write some code in perl (specifically) to output sound (specifically, MP3s) to my sound card. I've not seen any examples of outputting any sound to the soundcard in perl, so examples of that would be helpful.

My question is, how d开发者_如何学运维o audio players output sound to the sound card? Do they convert them to WAV on the fly?


SDL::Sound solves this problem for WAV files. There are several packages for converting compressed MP3 files to WAV, such as Audio::MPEG and Audio::ConvTools.


Are you on Linux? If so you can do your logic in Perl and then shell out to some command line player, like mpg123. Not a pure Perl solution, but gets the job done.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜