Why do I receive an error when I try to use the AUDIORECORDER function on a Macintosh in MATLAB 6.5 (R13)?

3 views (last 30 days)
Why do I receive an error when I try to use the AUDIORECORDER function on a Macintosh in MATLAB 6.5 (R13)?
When I use the AUDIORECORDER function in MATLAB 6.5 (R13) on a Macintosh operating system, I get the following error:
????Error using ==> audiorecorder
This function is only for use with 32-bit Windows machines.
Why am I unable to use the AUDIORECORDER function with a UNIX/MAC OSX operating system?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
This enhancement has been made for Release 14 (R14). For previous product releases, please read below for any possible workarounds:
The AUDIOPLAYER and AUDIORECORDER functionality has been implemented int MATLAB 7.0 (R14).
If you are using a previous version of MATLAB, if you are using a Macintosh that has a Java Virtual Machine of version 1.3 or higher, you can use the Java version of the AUDIORECORDER function. The following syntax is an example of how to use the Java version of AUDIORECORDER to record sound from a microphone:
r = com.mathworks.toolbox.audio.JavaAudioRecorder(44100, 16, 1);
%The first input argument is the sample rate, the second is the number of bits per sample and the
%third input argument is the number of channels.
r.record; %speak into microphone
r.stop;
signal = getaudiodata(r);
To play audio on the Macintosh system, use the Java version of the AUDIOPLAYER function. For example:
load handel
p = com.mathworks.toolbox.audio.JavaAudioPlayer(y,Fs,16);
p.play
Note that this usage of the Java Audio Recorder has not been fully tested by MathWorks, Inc.
The MATLAB version of the AUDIORECORDER function is currently available only on 32-bit Windows platforms.
Our development staff will look into adding similar functionality toUNIX/MAC OSX in a future release of MATLAB.
Some customers report the following error when trying to use the JavaAudioRecorder:
Unsupported audio format: interface TargetDataLine supporting format PCM_SIGNED, 44100.0 Hz, 16 bit, mono, big-endian, audio data.
To prevent this error, try other sampling rates, etc. -- 22050Hz, 8-bit, mono, stereo, to see if any combination of sampling rate/precision/channels will work.
The JavaAudioRecorder is still in the process of being tested on all platforms, which is why it is not officially supported.

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!