How to convert .csv file into audio file
11 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I have attached the sample file. Kindly help me to resolve the problem
2 Commenti
KSSV
il 10 Lug 2019
Load the data using csvread/xlsread/readtable
Pick the required column and use sound
Risposta accettata
Star Strider
il 10 Lug 2019
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 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Audio I/O and Waveform Generation in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!