Why does the BEEP function produce no sound?

2 ビュー (過去 30 日間)
MathWorks Support Team
MathWorks Support Team 2009 年 6 月 27 日
回答済み: cr 2018 年 8 月 27 日
When I run the BEEP function from the MATLAB prompt, I hear no sound.
beep

採用された回答

MathWorks Support Team
MathWorks Support Team 2009 年 6 月 27 日
This bug has been fixed in Release 14 Service Pack 2 (R14SP2). For previous releases, please read below for any possible workarounds:
This bug has been fixed for Release 14 SP1 (R14SP1). For previous releases, please read below for any possible workarounds:
This problem has been fixed in MATLAB 7.0.1 (R14SP1). If you are using a previous version, read the following:
This has been verified as a bug in MATLAB in the way that the BEEP command is executed on certain operating systems.
If you are not able to hear the system beep when you use the beep command, the following solution can be used to make a sound on your machine.
NOTE: This will not solve the problem of other functions that use BEEP, but it will allow you to have sound in your own applications.
The workaround involves creating another function (called, for example, beep2) which will play a sine wave.
function beep2
% Play a sine wave
res = 22050;
len = 0.5 * res;
hz = 220;
sound( sin( hz*(2*pi*(0:len)/res) ), res);

その他の回答 (1 件)

cr
cr 2018 年 8 月 27 日
I just discovered that if you change the default system beep sound in OS preferences while Matlab is open, beeps in Matlab will produce no sound. You will need to relaunch Matlab to produce the beep which will be the newly selected sound.

カテゴリ

Help Center および File ExchangeAudio and Video Data についてさらに検索

製品


リリース

R13SP1

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by