필터 지우기
필터 지우기

problem reading wav file

조회 수: 15 (최근 30일)
DOORYODHUN AHKU
DOORYODHUN AHKU 2021년 4월 5일
답변: Krishna bharath Gali 2024년 4월 20일
hi,
I created a folder in drive C on users. I copied the audio file .wav in it. i opened live Editor and did Alt/enter to create a text area and typed 'Assignment'. I then pressed Ctrl S to save it as 'Assignment _task' mlx onto the 'Assignment' folder in C. both the audio file and Mxs file appeared on matlab's 'my folder'. I then pressed Alt/enter to get into Code area. In Code area, i typed 'audioread('the wav file') and pressed Ctrl /enter. I came out with error as follows:
The file type is not supported
Error in audioread (line 136)
[y, Fs] = readaudio (filename, range, datatype);
my question are 1./ of how can i get the 'range' and know the 'datatype'?2./ why it said 'audioread>readaudio and error in 'audioread' 3./ am i supposed to get x and Fs and rows and column?
Can anyone help me of how to read the audio please?
thank you
D.A
  댓글 수: 1
DOORYODHUN AHKU
DOORYODHUN AHKU 2021년 4월 5일
Thank you very much Walter. Thats help.

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

채택된 답변

Walter Roberson
Walter Roberson 2021년 4월 5일
of how can i get the 'range' and know the 'datatype'?
The code for audioread() says
if nargin < 2
range = [1 inf];
datatype = 'double';
elseif nargin < 3 && ischar(range)
datatype = range;
range = [1 inf];
elseif nargin < 3
datatype = 'double';
end
You are not passing in anything other than the file name, so nargin < 2 so it is going to default to range [1 inf] and datatype 'double' .
That is, it is going to default to reading all of the file, and to returning the data as values in the range -1 <= x <= 1
Unless you have special requirements, those are the defaults that you want.
why it said 'audioread>readaudio and error in 'audioread'
The file type is not supported
Did you use a file name ending in .wav ? Did you use the .wav extension as part of the file name when you did the audioread() -- you should.
Also, some .wav files are not supported on some systems, as they require audio encoding schemes that are not supported on the system. You can see https://superuser.com/questions/72302/how-do-i-find-out-the-audio-format-of-a-wav-file/72340 for information on how to inquire about what audio encoding system the file is designed for.

추가 답변 (1개)

Krishna bharath Gali
Krishna bharath Gali 2024년 4월 20일
How to upload the audio file

카테고리

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