|
Guys, I'm trying to work on the following, and I seriously need some help.. I don't even know if this is the place to ask for help .. any help is greatly appreciated ..
A wave editor that must allow the user to:
1) Input two sound files “wav” format files,
2) Play the two sound files in full independently,
3) Allow the user to select a user chosen section from either of the two files and play that section only,
4) Allow the user to join sections together to make a new sound,
5) Play the new sound,
6) Save the new edited sound to disk in “wav” format.
The problem is simple and very easy to implement in other platforms(Flash AS2 etc.)
but I'm really stuck due to my complete lack for the syntax. :(
I need it in GUI mode but I haven't even been able to do it in console mode.
All I was able to do so far is :
[y,Fs,bits] = wavread('e:\rev.wav');
A = audioplayer(y,Fs);
play(A);
pause(A);
play(A);
pause(A);
resume(A);
stop(A);
Happy that I could hardly manage to play/pause/stop
Cut a specific length of wav from ONLY beginning of the file.
in_dir = 'c:\matlab7\work\practice\';
contents = dir(in_dir);
for i = 1:length(contents)
in_file = contents(i).name;
if (strfind(in_file, '.wav'))
fprintf(1, 'Trimming %s\n', in_file);
% Read data
[y Fs n_bits] = wavread(fullfile(in_dir, in_file));
% Work out how many samples in 5 seconds
n_samples = round(10*Fs);
% Write back out to dile, with TRIMMED_ pre-pended
wavwrite(y(1:n_samples), Fs, n_bits, fullfile(in_dir, sprintf('TRIMMED_%s', in_file)));
end
end
and a browse and save file ..
[filename, pathname, filterindex] = uigetfile('*.m', 'Open a file');
[FileName,PathName,FilterIndex] = uiputfile('*.wav', 'Save');
|