i am trying to write a MATLAB code to process two different .wav files the first one include a recording for the word “audio” in an approximately 5 seconds length .wav file?

2 ビュー (過去 30 日間)
recObj = audiorecorder;
disp('Start speaking.')
recordblocking(recObj, 5);
disp('End of Recording.');
y = getaudiodata(recObj);
figure
plot(y);
title('Hello World!')
audiowrite(recObj, 1, 22050);
play(recObj);
this what i was able to reach in the code but i keep getting a error like this
Error in audiowrite (line 111)
props = parseInputs(filename, y, Fs, varargin);
Error in Test1 (line 9)
audiowrite(recObj, 1, 22050);

採用された回答

Walter Roberson
Walter Roberson 2021 年 12 月 6 日
you have to tell audiowrite a file name. You do not have to tell it the number of channels. You have to pass the data to be written to it, which is y, not the recording object
  4 件のコメント
Faisal Alrafaei
Faisal Alrafaei 2021 年 12 月 6 日
thank you so much, it is working now but how can i save the .wav file or where can i find it?
Walter Roberson
Walter Roberson 2021 年 12 月 6 日
If you do not provide a directory as part of the file name then it will be saved in your current directory. You may wish to provide fully qualified file name.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAudio I/O and Waveform Generation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by