Audioread cannot find WAV file
Show older comments
Hello,
we are trying to load a WAV audio file into matlab for filtering. Oddly, It cannot seem to load the audio file without running into an incorrect path error. I have tried resetting the userpath and have also tried specifying the exact file location of audiofile instead of the file name. I have also tried turning the file location into a string variable named file but the results are the same. I am a bit puzzled in terms of what I might be doing wrong.
userpath("C:\Users\Jerry\Desktop\eeglab_current\eeglab2019_1")
[y,Fs] = audioread("PLEAS_43s_Male_Laugh")
Accepted Answer
More Answers (1)
Image Analyst
on 20 Dec 2019
Try this:
folder = 'C:\Users\Jerry\Desktop\eeglab_current\eeglab2019_1';
baseFileName = 'PLEAS_43s_Male_Laugh.wav'; % Include extension
fullFileName = fullfile(folder, baseFileName)
[y, Fs] = audioread(fullFileName); % Read into array
sound(y, Fs); % Play it
Categories
Find more on MATLAB Mobile in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!