Matlab audioread & audiowrite problem

Thread Starter

Noy Uzrad

Joined May 14, 2017
4
hi

I have a double data-type array.
when I write it into wav audio file using audiowrite, and later read it using audioread, i get different values from the original array.
they are both double, but still, values are different.

any ideas?
 

MrChips

Joined Oct 2, 2009
24,452
hi

I have a double data-type array.
when I write it into wav audio file using audiowrite, and later read it using audioread, i get different values from the original array.
they are both double, but still, values are different.

any ideas?
Can you post your MATLAB code?
 

MrChips

Joined Oct 2, 2009
24,452
audiowrite('wmed_signal1.wav' , wmed_signal1, Fs);

eval_signal_en = audioread('wmed_signal1.wav')';
Apparently audioread and audiowrite are using different formats or is doing some signal processing to the data.
What is your sampling frequency Fs?
Do you still have wavread and wavwrite on your version of MATLAB?
 

Thread Starter

Noy Uzrad

Joined May 14, 2017
4
OK fellows I had figured it out.
I had to add the arguments ('BitsPerSample', 64) to audiowrite function.

Thank you for your replys
 

John_2016

Joined Nov 23, 2016
55
Hi Noy Uzrad

you are missing the actual 'send-to-speakers' command

sound(y,Fs)

the audioread command only loads from the audio file to MATLAB workspace, it doesn't actually play it.

The reproduction of the audio file requires Fs to be specified, that is precisely the 2nd input field of command sound.

regards

John BG
 

MrChips

Joined Oct 2, 2009
24,452
Hi Noy Uzrad

you are missing the actual 'send-to-speakers' command

sound(y,Fs)

the audioread command only loads from the audio file to MATLAB workspace, it doesn't actually play it.

The reproduction of the audio file requires Fs to be specified, that is precisely the 2nd input field of command sound.

regards

John BG
Nice of you to contribute your MATLAB expertise.
Please do not Post Reply to old threads, especially when the problem has been solved and the TS is long gone.
 
Top