所以我一直为此苦苦挣扎。我应该只用一个soundsc(wave,fs)调用来播放一系列音调,但是当我尝试将音调波放入一个数组中时,它只是同时播放而不是连续播放。例如:
pitch1 = sin(2*pi*freq1*t);
pitch2 = sin(2*pi*freq2*t);
pitch3 = sin(2*pi*freq3*t);
concat_pitch = [pitch1; pitch2; pitch3]; % I want them to play in order, not together
soundsc(concat_pitch, fs); % this just plays them all together
谁能帮我吗?谢谢。
最佳答案
更改串联以形成单行 vector :
concat_pitch = [pitch1, pitch2, pitch3];
或者,如果您指定的串联很重要并且必须保持原样,则可以遍历二维矩阵的行:
for ind=1:length(concat_pitch)
soundsc(concat_pitch(ind,:), fs);
end
关于audio - 在MATLAB中连续播放音高,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21346750/