Undefined function 'mtimes' for input arguments of type 'audiorecorder'.

1 view (last 30 days)
I have downloaded the speaker recognition system that uses MFCC or WAVELET SUB BAND CODING methods written by "raghu ram". It is a great effort and it was so beneficial to me. I am using the code in a newer MATLAB version (R2014a), so I have replaced functions: wavread, wavplay and wavrecord by audioread, audioplayer and audiorecorder respectively.
Here is my problem: In the sound editor GUI, when I press in the "Record" button for a number of seconds, instantly a "recording finished" message appears in the interface, and an error appears in the command window. This is the error:
Undefined function 'mtimes' for input arguments of type 'audiorecorder'. Error in gui>bt_record_callback (line 115) signal=0.99*data/max(abs(data)); Error in gui_mainfcn (line 95) feval(varagin{:}); Error in gui (line 49) gui_mainfcn(gui_state, varagin{:}); Error while evaluating uicontrol callback
Note that, please, as I have said previously I have replaced wavrecord in line 113 by audiorecorder.
does any one has suggestions as a solution for my problem?
Thanks a lot. Regards. Shadi Ayyad.

Accepted Answer

David Young
David Young on 21 Apr 2015
Presumably you replaced
data = wavrecord( ... );
by
data = audiorecorder( ... );
(I don't know what arguments were used.) If so, try this instead
audioRec = audiorecorder;
audioRec.recordblocking(5);
data = audioRec.getaudiodata;
That will record for a fixed time of 5 seconds. You probably want to replace the 5 with a variable holding the time to record for. Alternatively, you can record for an indefinite length of time and call the stop method from your GUI to stop recording. See the audiorecorder documentation for details
Note also that you can set all sorts of parameters in the call to audiorecorder - see the documentation.
It's also inefficient to create a new audiorecorder object each time you want to record something - ideally you'd call audiorecorder once only and then hold onto the audiorecorder object.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!