"Unrecognized function or variable 'filename'. Error in audioread (line 82) filename = convertStr​ingsToChar​s(filename​);'

5 vues (au cours des 30 derniers jours)
Marsha Groen
Marsha Groen le 24 Juil 2021
Commenté : Jan le 26 Juil 2021
I am building the MIT Radar course, where you can download the doppler files. With the Doppler Files is a .wav file. I typed in
[Y, FS]= audioread('Off of Newton Exit 17.wav');
because this contains both variable values. I ran this last night and it worked. But I woke up this morning to run it again and it keeps giving me this 'Unrecognized function or variable 'filename' error. I tried using convertStringsToChars('Off of Newton Exit 17.wav') which it goes through, but it doesn't pull the variables like I need it to. it returns to the same error. I have tried changing the location, I have taken the entire address out of the audioread. Nothing has worked yet.
I looked up the error advising that the parsen is <0... I am absolutely stuck. Any help would be great. Thank you

Réponses (2)

Jan
Jan le 24 Juil 2021
Modifié(e) : Jan le 24 Juil 2021
Your variable "info" is a struct, not a char vector or string.
info = audioinfo('Off of Newton Exit 17.wav');
[Y, FS] = audioread(info.Filename);
Under Matlab R2018b your code fails also, but with a different error message.
  8 commentaires
Jan
Jan le 25 Juil 2021
@Walter Roberson: Do you mean:
dbtype audioread 1 % not fileread
Jan
Jan le 25 Juil 2021
Modifié(e) : Jan le 25 Juil 2021
@Marsha Groen: Please post code as text and not as screen shots.
I asked you to copy my code carfully.
% My code:
info = audioinfo('Off of Newton Exit 17.wav');
% Your code
info = audioinfo('Off of Newton Exit 17.wav ');
% ^ additional space
Your code should fail with the error message:
% Error using audioinfo (line 51)
% The filename specified was not found in the MATLAB path.
Trailing spaces are not allowed for file names under Windows.
You have tried a lot of versions, which contain a variety of typos:
[data, FS] = audioinfo('Off of Newton Exit 17.wav');
[data, FS] = audioread('info');
[data, FS] = audioinfo(info;
[data, FS] = audioinfo(info);
[Y, FS] = audioread(info.Off of Newton Exit 17.wav);
info = audioinfo('Off of Newton Exit 17.wav ');
function [y,Fs] = audioread('Off of Newton Exit 17.wav', double);
[Y, FS] = audioread;
Programming languages are very susceptible for inserting some characters at the wrong locations. You have to crae for writing exactly want is needed. There is not fuzzy logic, which tries to fix such typos automagically.

Connectez-vous pour commenter.


Jan
Jan le 25 Juil 2021
Modifié(e) : Jan le 25 Juil 2021
A very bold guess:
Are you working with admin privileges? Did you open the file audioread.m and overwrite the first line of code, which should be
function [y,Fs] = audioread(filename, range, datatype)
How does the function start on your computer?
edit audioread
  8 commentaires
Marsha Groen
Marsha Groen le 25 Juil 2021
I had to uninstall the software and reinstall it on the PC instead of my external harddrive. It works now thank goodness. I appreciate all hands that were helping out, thank you for your time.
Jan
Jan le 26 Juil 2021
You are welcome. Matlab problems are the purpose of this forum. The harder the problem, the more useful is the help. :-)

Connectez-vous pour commenter.

Catégories

En savoir plus sur Programming dans Help Center et File Exchange

Produits


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by