开发者

How to output MP3s to a sound card

开发者 https://www.devze.com 2023-02-20 19:29 出处:网络
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 o

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

精彩评论

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