Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
i want to add keyboard voice to my voice. how i can add two audio waves? here no. of samples are 48000.. in this i am recieving an error that ??? Error using ==> vertcat CAT arguments dimensions are not consistent. how i can solve
조회 수: 1 (최근 30일)
이전 댓글 표시
[y,fs,nbits]=wavread('C:\Users\HP\Desktop\anjali.wav');
sound(y,fs)
t=0:1/fs:length(y)/fs-1/fs;
%%%%%% keyboard noise
[z,fs,nbits]=wavread('C:\Users\HP\Desktop\keyboard.wav');
sound(z,fs)
t1=0:1/fs:length(z)/fs-1/fs;
%%%%%%%%%
y3 = [y(1:24000:); z; y(24000:end)];
sound(y3,fs)
t=0:1/fs:length(y)/fs-1/fs;
댓글 수: 2
Jan
2013년 4월 5일
편집: Jan
2013년 4월 5일
I suggest to spend the time for reading the thread with the second most votes in this forum: http://www.mathworks.com/matlabcentral/answers/29922-why-your-question-is-not-urgent-or-an-emergency
Please learn how to format code properly in the forum to increase the readability. This would be a good idea, when you want to encourage others to read and understand your code.
Posting unrelated code is usually too confusing to be efficient. Does you problem have any relation to the plotting of the signals? If not, take the chance to edit your original question and remove the corresponding parts of the code, such that we can concentrate on the essential parts without excessive scrolling.
The unclear explanation of the problem and the bad layout of the question does not correlate to the claim, that this question is "urgent".
답변 (1개)
Jan
2013년 4월 5일
The error message is clear:
vertcat CAT arguments dimensions are not consistent
This means, that the dimensions of y and z are not matching. And because you concatenate (not "add"!) them vertically, it must be the 2nd dimension. When the WAV-files are recoreded in stereo, the signals have two columns. But y(1:24000) replies a part of the first column only. Please try:
y3 = [y(1:24000, :); z; y(24000:end, :)];
If this fails also, check if both WAV files have the same number of channel, or in other word are both mono or stereo.
Using the debugger would reveal such problems easily and much faster than the forum: Set a breakpoint in the crashing line or let Matkab stop automatically when an error occurs:
dbstop if error
Then split the command into parts:
a = y(1:24000);
b = y(2400:end);
size(a)
size(b)
size(z)
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!