Audioread error: TotalSamples is 0.

Dear All
I am trying to read a .wav file:
[y, Fs] = audioread('Rockblast_copy.wav')
but I get this error:
"Error using audioread (line 135) Range requested is greater than the total number of samples in the file. TotalSamples is 0."
The wav file has no issues - I can listen to it using other software. The file is ~300 MB
Any thoughts?
George

답변 (1개)

Walter Roberson
Walter Roberson 2017년 2월 20일

0 개 추천

The fact that you can read an audio file in other software does not mean that the audio file is correct. Different software deals with broken files in different ways, and different software deals with extensions to the standard in different ways.

댓글 수: 4

George_bcm CHRIS
George_bcm CHRIS 2017년 2월 22일
Thanks a lot - so you are implying that the file is corrupted or not correct. But still I do not think the whole file is incorrect. I understand that Matlab might be unwilling to use a file with some errors but this might be too conservative - i.e. possibly rejecting a whole file for a small error. Is there a way I can somehow read it, even with corrections?
Alternatively, how could I possibly ensure that subsequent files are ok?
Thanks again
George_bcm CHRIS
George_bcm CHRIS 2017년 2월 22일
Or at least a way I could fix the file- inside or outside matlab. g
Walter Roberson
Walter Roberson 2017년 2월 22일
You could use one of the other pieces of software you mention to re-save the file.
Also, if you are using R2016a or R2016b, it would not hurt to install the patch to sound and audioplayer, https://www.mathworks.com/support/bugreports/1445234
Paolo Posa
Paolo Posa 2020년 10월 12일
is it possible to exclude/delete these files programatically?

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

카테고리

태그

질문:

2017년 2월 20일

댓글:

2020년 10월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by