How do I play a sound in Octave?

后端 未结 7 2152
后悔当初
后悔当初 2020-12-09 20:36

Octave appears to assume that a specific sound playing utility will be available on a system but doesn\'t seem to provide the ability to specify an alternate. In the error

7条回答
  •  再見小時候
    2020-12-09 20:55

    I am on a Mac (Yosemite), and discovered a simpler solution than what others have suggested. Just in case this is still relevant for anybody:

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

    (via Homebrew)

    brew install sox
    

    Now on the terminal command line you can use:

    play “/path/to/sound file.wav"
    

    ...and you will hear beautiful music.

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

    system(‘play “/path/to/sound file.wav”’);
    

提交回复
热议问题