fix_offset.m
Go to the documentation of this file.
1 function [] = fix_offset(melody,melodyps)
2 %e.g. fix_offset('melody.wav','melody_ps12.wav');
3 
4 x = wavread(melody);
5 y = wavread(melodyps);
6 
7 ind1 = find(x>0, 1, 'last');
8 ind2 = find(y>0, 1, 'last');
9 
10 y = [zeros(ind1-ind2,1); y];
11 wavwrite(y,44100,melodyps);
wavwrite(y, 44100, melodyps)
ind2
Definition: fix_offset.m:8
y
Definition: fix_offset.m:5
ind1
Definition: fix_offset.m:7
Load melody file melody
x
Definition: fix_offset.m:4