开发者

Audiorecorder on matlab for Macintosh

开发者 https://www.devze.com 2023-03-30 19:19 出处:网络
Most functions for audiorecorder are only supported for the windows开发者_运维问答 version. I have a 4-microphone array and i want to use each one separately. But i cannot specify the deviceID as it i

Most functions for audiorecorder are only supported for the windows开发者_运维问答 version. I have a 4-microphone array and i want to use each one separately. But i cannot specify the deviceID as it is not supported in Mac. It just uses the default device. It displays the following warning:

Warning: DeviceID parameter can only be set on Windows

IS there any option to do this?


I am working on similar problem: want to record from 2 microphones.

First of all: on Mac OS X, Matlab versions earlier than r2011a don't have multi input device support. So you must upgrade to r2011a. I've found in Matlab's r2011a release notes (http://www.mathworks.com/help/pdf_doc/matlab/rn.pdf page 18)

audioplayer and audiorecorder Support Device Selection on All Platforms audioplayer and audiorecorder now allow you to specify the input or output device on all supported platforms. In previous releases, you could only specify devices on Microsoft Windows systems.

I'm testing it now, but it seems not to work properly (Built-in Input can't handle 44100Hz, 16bit, 1 channel recording) :-/

Upgrade to r2011a and we will try to solve this problem together.

*Upadte** Here is what I did: List all audio devices:

>> audiodevinfo

ans = 

     input: [1x2 struct]
    output: [1x1 struct]

List each input device:

>> audiodevinfo(1,0)

ans =

Built-in Microphone (Core Audio)

>> audiodevinfo(1,1)

ans =

Built-in Input (Core Audio)

Test desirable device (for me it was jack-plugged microphone):

>> audiodevinfo(1,1, 44100, 16, 1)

ans =

     1

function returned 1, so device IS ABLE to record 44100Hz,16bit,1channel audio signal.

Create audiorecorder object connected to desirable device:

r = audiorecorder(44100,16,1,1);

Record audio using recordblocking function (I don't need to record asynchronously and prefer recordblocking istead of record function, because I can see when recording process is finished).

Play it.

play(r);

Everything work's fine for me:)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号