Need Help in importing Audio files
조회 수: 3 (최근 30일)
이전 댓글 표시
Hi, I want to import 50 audio files with name as "s1,s2,...s50" and train them for speaker recognition purpose.
if true
[training_data1,fs_training1]=audioread('C:\Users\Satyam\Documents\MATLAB\SOP\data\train\S1.wav');
[training_data2,fs_training2]=audioread('C:\Users\Satyam\Documents\MATLAB\SOP\data\train\S2.wav');
[training_data3,fs_training3]=audioread('C:\Users\Satyam\Documents\MATLAB\SOP\data\train\S3.wav');
[training_data4,fs_training4]=audioread('C:\Users\Satyam\Documents\MATLAB\SOP\data\train\S4.wav');
[training_data5,fs_training5]=audioread('C:\Users\Satyam\Documents\MATLAB\SOP\data\train\S5.wav');
[training_data6,fs_training6]=audioread('C:\Users\Satyam\Documents\MATLAB\SOP\data\train\S6.wav');
[training_data7,fs_training7]=audioread('C:\Users\Satyam\Documents\MATLAB\SOP\data\train\S7.wav');
[training_data8,fs_training8]=audioread('C:\Users\Satyam\Documents\MATLAB\SOP\data\train\S8.wav');
end
something like this.
how can I use loop, "like for or while" in this process? TIA
댓글 수: 0
답변 (1개)
Dinesh Iyer
2018년 4월 27일
You can use the FileDataStore object and supply audioread as the custom read function. This will save you the hassle of looping:
fds = fileDatastore('C:\Users\Satyam\Documents\MATLAB\SOP\data\train\','ReadFcn',@audioread, 'FileExtensions', '.wav');
while hasdata(fds)
[y, Fs] = read(fds);
end
See the documentation for this function here: https://www.mathworks.com/help/matlab/ref/matlab.io.datastore.filedatastore.html
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Speech Recognition에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!