Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Hello, How can I convert the loaded audio object (myGui.player) to a numeric arr

ID: 1840573 • Letter: H

Question

Hello, How can I convert the loaded audio object (myGui.player) to a numeric array? (see the code below)

so I can quantize it later.

I tried ( getaudiodata) function but it did not work

Your help is highly appreciated..

The code I used it:

Fs = str2num(get(handles.Fs,'String'));

myGui=guidata(handles.figure1);

[file,path] = uigetfile('*.wav','Seleccione un archivo de sonido');

[x,fs] = audioread([path file]);

myGui.freqSam=fs;

myGui.datasound=x;

myGui.player=audioplayer(myGui.datasound,myGui.freqSam);

myGui.flag=2;

play(myGui.player);

pause(7);

myGui.freqSam=Fs;

myGui.datasound=x;

myGui.player=audioplayer(myGui.datasound,myGui.freqSam);

myGui.flag=2; play(myGui.player);

%%y = getaudiodata(myGui.player);

guidata(handles.figure1,myGui)

Explanation / Answer

use the same code

Fs = str2num(get(handles.Fs,'String'));

myGui=guidata(handles.figure1);

[file,path] = uigetfile('*.wav','Seleccione un archivo de sonido');

[x,fs] = audioread([path file]);

myGui.freqSam=fs;

myGui.datasound=x;

myGui.player=audioplayer(myGui.datasound,myGui.freqSam);

myGui.flag=2;

play(myGui.player);

pause(7);

myGui.freqSam=Fs;

myGui.datasound=x;

myGui.player=audioplayer(myGui.datasound,myGui.freqSam);

myGui.flag=2; play(myGui.player);

%%y = getaudiodata(myGui.player);

guidata(handles.figure1,myGui)

but change "getaudiodata" to "audioinfo"

the code might work.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote