Audio Writing And Saving Location

조회 수: 7 (최근 30일)
Suleyman Serhani
Suleyman Serhani 2018년 12월 31일
댓글: Walter Roberson 2018년 12월 31일
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);

답변 (2개)

Walter Roberson
Walter Roberson 2018년 12월 31일
audiowrite('OutputFileNameGoesHere.wav', y, 44100);

Suleyman Serhani
Suleyman Serhani 2018년 12월 31일
thank you i found it,
it save automacally to documents file but my computer however it save to install directory
  댓글 수: 1
Walter Roberson
Walter Roberson 2018년 12월 31일
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);

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Audio and Video Data에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by