Audio Writing And Saving Location

4 ビュー (過去 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 Center および File ExchangeAudio and Video Data についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by