Solving MATLAB Error wavread: Incorrect Chunk Size Info

  • Context: MATLAB 
  • Thread starter Thread starter Sahand_S
  • Start date Start date
  • Tags Tags
    Matlab
Click For Summary
SUMMARY

The forum discussion addresses an error encountered in MATLAB when using the wavread function, specifically the message "Incorrect chunk size information in WAV file." The error occurs during the execution of the fseek function, which fails to seek the specified chunk size in the WAV file, leading to an exception being thrown. The issue is identified at line 166 of the wavread function, indicating a problem with the WAV file's format or structure. Users are advised to inspect the WAV file's header information to ensure it conforms to the expected specifications.

PREREQUISITES
  • Understanding of MATLAB programming language
  • Familiarity with audio file formats, particularly WAV files
  • Knowledge of file handling functions in MATLAB, such as fseek and fclose
  • Basic debugging skills in MATLAB to trace errors
NEXT STEPS
  • Investigate the structure of WAV file headers and chunk sizes
  • Learn about MATLAB's wavread function and its parameters
  • Explore error handling techniques in MATLAB to manage file reading exceptions
  • Examine alternative audio reading functions in MATLAB, such as audioread
USEFUL FOR

MATLAB developers, audio engineers, and data scientists working with audio file processing who need to troubleshoot and resolve WAV file reading errors.

Sahand_S
Messages
2
Reaction score
0
Hi.

I tried to use wavread comment but on some wave files, it showed me following error:

Code:
? Error using ==> wavread at 166
Incorrect chunk size information in WAV file.

Please help me. thanks a lot.
 
Physics news on Phys.org
This is where it finds the error
Code:
 if fseek(fid,ck.Size,0) == -1
         error('wavread:InvalidFile', ...
             'Incorrect chunk size information in WAV file.');
      end

This is what sends the error

Code:
 catch exception
    fclose(fid);
    throw(exception);  % line 166
end

So yeah, sorry I can't be more help, but you need to look at the first bit of code as this is where it finds an error. (fseek line)
 
Thanks a lot.
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 4 ·
Replies
4
Views
7K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 11 ·
Replies
11
Views
5K
  • · Replies 2 ·
Replies
2
Views
2K