How do I concatenate two or more wav files in Matlab. This is a code that I've been trying to implement in order to play a continous song, but it just plays the wav files one by one. Please help me.

1 回表示 (過去 30 日間)
function [a b]=Get_Wavfile(n,m);
switch n
if m ==1
[a b] = wavread('E:\Samples\002.wav',[1 36000]);
elseif m==2
[a b] = wavread('F:\Samples\009.wav',[1 36000]);
else
[a b] = wavread('F:\Samples\007.wav',[1 36000]);
end
end
%------------------------------------------
x = [1 1 1];
y = [1 2 4];
for i=1:3,
[a b]=Get_Wavfile(x(i),y(i));
[d]=[a]
end
sound(d,b)
%-------------------------------------------

採用された回答

Walter Roberson
Walter Roberson 2012 年 11 月 7 日
Before your "for" loop,
d = [];
Inside your for loop, change [d]=[a] to
d = [d;a];

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by