audio - 在MATLAB中连续播放音高

标签 audio matlab matlab-figure

所以我一直为此苦苦挣扎。我应该只用一个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/

相关文章:

audio - 将多个 RTP 流混合成一个流

matlab - 为什么MatLab会中断某些变量输入?

windows - Mac 和 Windows 之间的 Matlab GUI 兼容性(显示)

matlab - 使用 fmincon ODE Matlab 进行优化

matlab - 从 MATLAB 中的编辑框获取数值

android - VLC在此媒体Android上遇到错误

c# - 声音播放器问题? boolean 语句应执行声音

java - 如何将声音(WAV)写入文件

matlab - 回调函数中的 Getrect() 有运行时错误

matlab - 如何使网格线与刻度线颜色相同