Saving Audio Recordings to separate Directories
Show older comments
I'm working on trying to record audio save save it to separate directories based on different speakers. Does anyone know a way to have audio files recorded to different directories.
overall I'm trying to set up a GUI so that I can click speaker 1, 2, 3, etc... and record that audio and save it to its respective directory, can anyone help me out??
Answers (1)
Image Analyst
on 11 Apr 2013
% Build the custom folder name for this particular speaker:
theFolder = sprintf('c:/Users/Trent/documents/Speakers/Speaker_%d', speakerNumber);
if ~exist(theFolder, 'dir')
% Create folder if it does not exist.
mkdir(theFolder);
end
% Specify the base name.
baseFileName = sprintf('Speaker %d sound clip.wav', speakerNumber);
% Combine base name plus folder to form the full filename.
fullFileName = fullfile(theFolder, baseFileName);
% Write it out to disk.
wavwrite(soundClipArray, fullFileName);
Categories
Find more on Audio and Video Data in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!