MATLAB Answers

Error using audioDatastore/read (line 25)

45 views (last 30 days)
Zihui Cai
Zihui Cai on 3 Mar 2021
Commented: jibrahim on 3 Mar 2021
I have run my program on my MacBook (R2020a), there is no such error, however, after i copied my whole program to another Windows computer (R2019a) there is a error message for Error using audioDatastore/read (line 25)
Error using audioDatastore/read (line 25)
File could not be read due to an unexpected error. Reason: File contains data in an unknown format.
However, the audio files in the folder are all in .wav format.
Could you please help to check what's wrong with this?

Answers (1)

Walter Roberson
Walter Roberson on 3 Mar 2021
Wav files permit a number of different codecs (algorithms for encoding data). The software used to decode is sort of like a plug-in, not necessarily present unless installed. Your Mac has the kind of codec software needed to read the files, but the other computer does not.
Sometimes it is easiest to use VLC to examine the file to find out the signature of the codec, which is a 4-letter code that indicates which codec is needed.
  7 Comments
jibrahim
jibrahim on 3 Mar 2021
Hi Zihui,
Can you try reading those wav files using audioread? It will be helpful to know if audioread errors out as well.

Sign in to comment.

Products


Release

R2019a

Community Treasure Hunt

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

Start Hunting!