开发者

What are the possible ways to play audio from octave on a Mac?

开发者 https://www.devze.com 2022-12-26 21:44 出处:网络
playaudio() dies because there\'s no /dev开发者_如何学Go/dsp. None of the outputs from saveaudio() in various formats seem to be playable in QuickTime or VLC.

playaudio() dies because there's no /dev开发者_如何学Go/dsp.

None of the outputs from saveaudio() in various formats seem to be playable in QuickTime or VLC.

Ideal of course would be something like playaudio(), saving a file and playing it is a work-around that's hideously sub-optimal, but better than nothing.


So, this question is ultra old, but since I just had to solve it and could not find any direct answers on the web, thought I would write something here:

First install SoX: http://sox.sourceforge.net/

Now on the terminal command line you can use:

play “sound file.wav"

...and you will hear beautiful music.

But that command does not work from within Octave. This does work:

system(‘play “sound file.wav”’);
0

精彩评论

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

关注公众号