alert sound
조회 수: 32 (최근 30일)
이전 댓글 표시
Hi , i have if condition in my code and i want to produce alert sound in wrong case. can i do that ????
댓글 수: 0
채택된 답변
추가 답변 (5개)
Jan
2011년 12월 20일
WarnWave = [sin(1:.6:400), sin(1:.7:400), sin(1:.4:400)];
Audio = audioplayer(WarnWave, 22050);
play(Audio);
댓글 수: 4
v k
2020년 10월 26일
Need something similar to this, which gives a sound when the Whatsapp message comes, or an incoming SMS. A whooshing or a swishing sound.
What structure of WarnWave will give such a notification sound?
Daniel Shub
2011년 12월 20일
So here is an absolutely ugly Windows XP hack that gets the SystemExclamation sound from the registry and replaces environment variables with the correct values and then plays the sound.
[~, tempStr] = system('reg query HKEY_CURRENT_USER\AppEvents\Schemes\Apps\.Default\SystemExclamation\.Current');
[~, valueStart] = regexp(tempStr, 'REG_EXPAND_SZ ');
soundStr = tempStr(valueStart+1:(end-1));
envVarSymbol = strfind(soundStr, '%');
while length(envVarSymbol) >= 2
soundStr = [soundStr(1:(envVarSymbol(1)-1)), ...
getenv(soundStr((envVarSymbol(1)+1):(envVarSymbol(2)-1))), ...
soundStr((envVarSymbol(2)+1):end)];
envVarSymbol = strfind(soundStr, '%');
end
[x, Fs] = wavread(soundStr);
sound(x, Fs)
I need to think about this idea more. Interfaces really should be playing system sounds (yuk, who actually has system sounds set to on) at the appropriate times.
댓글 수: 2
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!