检测到 activity 后发出警报

Alert once an activity is detected

我的程序是在检测到声音后自动录制,我想在程序开始录制后发出声音警报。

您可以使用beep as a quick solution. If you have a particular sound file you'd like to use, you can use wavread to load the file into Matlab and soundsc播放它。

仅供 OS X 用户使用的一点乐趣 – 您可以使用内置的文本转语音终端命令 say in conjunction with Matlab's unix:

unix('say starting');

或者,如果您愿意:

if ismac
    unix('say starting');
else
    beep;
end

此外,可以使用 afplay. The sounds are AIFF files and are located at /System/Library/Sounds/. Here is how to play the famous Sosumi alert:

播放所有内置 OS X 警报声音
unix('afplay /System/Library/Sounds/Sosumi.aiff');