Error using sound in Xubuntu 20.04

2 ビュー (過去 30 日間)
Gianluca Marchetti
Gianluca Marchetti 2020 年 7 月 20 日
編集済み: Gianluca Marchetti 2020 年 7 月 20 日
Hi, I have installed Xubuntu 20.04 and then I have installed Matlab 2020.
I wrote the next code:
function suona(n)
h1=repmat([-1 1],1,250);
h2=repmat([-1 1],1,500);
h3=repmat([-1 1],1,1000);
for i=0:n
sound(h1,2000)
sound(h2,4000)
sound(h3,8000)
end
then when I run i.e. suona(7) I receive the next error:
>> suona(7)
Error using sound (line 76)
Device Error: Invalid sample rate
Error in suona (line 6)
sound(h1,2000)
The same code worked on the same laptop when there was Xubuntu 18.04.
I have installed Xubuntu 20.04 formatting the hard disk. My audio device is Intel Haswell HDMI.
a@PC07:~$ cat /proc/asound/card0/codec* | grep Codec
Codec: Intel Haswell HDMI
How can I do to work the sound function?

回答 (0 件)

カテゴリ

Help Center および File ExchangeAudio I/O and Waveform Generation についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by