필터 지우기
필터 지우기

create arrays from wav file

조회 수: 4 (최근 30일)
sam aldoss
sam aldoss 2018년 9월 30일
댓글: Walter Roberson 2018년 10월 2일
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 ?

답변 (1개)

Image Analyst
Image Analyst 2018년 9월 30일
  댓글 수: 2
sam aldoss
sam aldoss 2018년 10월 2일
this shows how to save txt file and other but it does not do the wav reading
Walter Roberson
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 CenterFile Exchange에서 Audio and Video Data에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by