How can i mix two .wav files ..iam using this code as show in figure but it gives an error?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Muhammad Saim Nasir Siddiqui
am 4 Mai 2015
Kommentiert: Walter Roberson
am 19 Mär. 2024
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/149743/image.png)
3 Kommentare
Muhammad Saim Nasir Siddiqui
am 4 Mai 2015
Bearbeitet: Walter Roberson
am 19 Mär. 2024
Muhammad Saim Nasir Siddiqui
am 4 Mai 2015
Bearbeitet: Walter Roberson
am 19 Mär. 2024
Akzeptierte Antwort
Jan
am 4 Mai 2015
It seems like y and z have different lengths. How do you want to handle this? Do you want to crop the longer signal or to pad the shorter signal with zeros? How do you want to treat amplitudes higher than 1.0 after the addition? Any kind or normalization?
Perhaps this helps:
lenY = size(y, 1); % Or is this the 2nd dimension?
lenZ = size(z, 1);
len = max(lenY, lenZ);
S = zeros(len, size(y, 2));
S(1:lenY, :) = y;
S(1:lenZ, :) = S(1:lenZ, :) + z;
mavValue = max(abs(S(:));
S = S \ maxValue;
2 Kommentare
Weitere Antworten (1)
BOUGOSSA HADJER
am 19 Mär. 2024
close all
clear all
clc
[y1,fs,bits] = wavread('C:\Users\Sid\Desktop\sid1.wav');
sound(y3,fs);
1 Kommentar
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!