See the FAQ for two code samples: http://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F
create arrays from wav file
4 ビュー (過去 30 日間)
古いコメントを表示
hello
am beginner in Matlab and am working on Audio signals. am trying to create a data from folds that contains 256 files(wav) to be analysis ?
0 件のコメント
回答 (1 件)
Image Analyst
2018 年 9 月 30 日
2 件のコメント
Walter Roberson
2018 年 10 月 2 日
projectdir = 'Name_of_folder_goes_here';
dinfo = dir( fullfile(projectdir, '*.wav') );
filenames = fullfile( projectdir, {dinfo.name} );
for K = 1 : length(filenames)
thisfile = filenames{K};
[~, basename, ~] = fileparts(thisfile);
newfile = fullfile(projectdir, [basename, '.txt']);
[data, fs] = audioread(thisfile);
save(newfile, 'data', '-ascii', '-double');
end
This will create a .txt file in the same directory and with the same basic name as the .wav file.
These files will not be efficient ways to process the signals. About the only reason to create such files would be if you were processing the files with external software -- and if you were then it would be important to know what file format the external software needed.
参考
カテゴリ
Help Center および File Exchange で Audio and Video Data についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!