Audio Writing And Saving Location
3 views (last 30 days)
Show older comments
Hello Everyone,
i recorded my voice with below code and now i must get it for using another matlab code,
how can i get my voice as a mp3 or wav from matlab.
close all; clear all;
% get device information
dev = audiodevinfo;
% create recorder object
seskaydet = audiorecorder(44100, 16, 1);
% start recording
disp('start speaking');
% record(rec, 5); % will record for 5sec. for this command pause needs to be added
recordblocking(seskaydet, 2);
% stop recording
disp('Stop recording');
% Play recorded sound
play(seskaydet);
% get audio data
y = getaudiodata(seskaydet);
% plot the sound
plot(y);
0 Comments
Answers (2)
Suleyman Serhani
on 31 Dec 2018
1 Comment
Walter Roberson
on 31 Dec 2018
If by "install directory" you mean the directory that MATLAB itself is installed in, then if you are using MS Windows, you would need to either Run As Administrator or else install MATLAB somewhere outside of the system Program Files directory. MS Windows blocks ordinary users from writing files into the Program Files directories.
You can specify a full path to save the file when you audiowrite it. For example,
audiowrite('C:\Users\suleyman\CS207\MATLAB\Assignmen3\OutFiles\OutputFileNameGoesHere.wav', y, 44100);
See Also
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!