How to convert .csv file into audio file
조회 수: 17 (최근 30일)
이전 댓글 표시
I have attached the sample file. Kindly help me to resolve the problem
댓글 수: 2
KSSV
2019년 7월 10일
Load the data using csvread/xlsread/readtable
Pick the required column and use sound
채택된 답변
Star Strider
2019년 7월 10일
Using numbered variables is never a good idea.
Do this instead:
T=readtable('2khz.csv');
A = table2array(T(:,3:8));
Then, in the save call, add ‘Fs’:
Fs=6000;
save('mymat.mat','Fs','A')
You can then use audiowrite with the matrix:
audiowrite('mymat.wav',A,Fs);
You can import all your data with audioread, however sound will only work with at most two channels:
[y,Fs]=audioread('mymat.wav');
sound(y(:,3:4),Fs);
for example.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
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!