audioread() randomly stops working

Hi all,
I keep having this issue where the audioread() function will stop working. If I try to import a .wav file, I get the 'Too many input arguments.' error, even though there is only 1 file in the directory by that name. If I restart Matlab it will work again, but I hate to lose all of the data I've been working on just to get the function to work again.
It also seems like this affects the sound() function as well. Could one of my toolboxes have gotten corrupted?
Thanks for any help!

댓글 수: 6

Walter Roberson
Walter Roberson 2015년 5월 19일
Please show a full trace of one of the "Too many input arguments" error occurring.
jmerritt
jmerritt 2015년 5월 19일
편집: jmerritt 2015년 5월 19일
I'm not sure how to do a full trace, but hopefully this is what you're looking for:
disp(err)
message: 'Error using <a href="matlab:matlab.internal.language.introspecti...'
identifier: 'MATLAB:audiovideo:audioread:fileNotFound'
stack: [1x1 struct]
disp(err.message)
Error using audioread (line 74)
The filename specified was not found in the MATLAB path.
disp(err.stack)
file: 'C:\Program Files\MATLAB\R2014b\toolbox\matlab\audiovideo\audioread.m'
name: 'audioread'
line: 74
disp(err.identifier)
MATLAB:audiovideo:audioread:fileNotFound
disp(err.stack)
file: 'C:\Program Files\MATLAB\R2014b\toolbox\matlab\audiovideo\audioread.m'
name: 'audioread'
line: 74
Walter Roberson
Walter Roberson 2015년 5월 19일
That is not even close to "Too many input arguments".
The file you are trying to open cannot be found. Perhaps you cd'd to a different directory.
jmerritt
jmerritt 2015년 5월 19일
I didn't CC into another directory, though - I've confirmed that my current file path contains the file I'm trying to load via 'pwd' and 'dir'. It just ... won't open it.
I'm working with some code that imports a bunch of files to train models, so perhaps there's a flag that gets overwritten in there that messes with audioread() somehow?
One obscure possibility is that you might be running out of Open File Descriptors, if you have a bunch of open files that were never closed. Try
fclose('all')
when it happens, and see if you can then repeat the command.
jmerritt
jmerritt 2015년 5월 19일
Ah, I fixed the issue! Turns out, there was some errant code adding directories to my search path. Removing them fixed the issue.
Thank you for the help! I'll definitely keep that command in mind for the future.

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

답변 (0개)

카테고리

질문:

2015년 5월 19일

댓글:

2015년 5월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by