record icon indicating copy to clipboard operation
record copied to clipboard

Cannot choose a device to record

Open HydroCarbon opened this issue 11 months ago • 3 comments

Package version

Environment

  • OS: macOS 14.3.1
  • Browser: Chrome

Describe the bug

I use this config to record stream:

RecordConfig config = RecordConfig(
      device: _inputDevice,
      encoder: AudioEncoder.pcm16bits,
      sampleRate: 16000,
      numChannels: 1,
);

Stream<Uint8List> recordStream = await _audioRecorder.startStream(config);

Expected to record audio from choosen device(_inputDevice), and this is code to choose device:

_audioRecorder
        .listInputDevices()
        .then((devices) => devices.firstWhere(
            (device) => device.label == deviceLabel,
            orElse: () => devices.first))
        .then((device) => _inputDevice = device)

when I use diffenrent label, it always record from macos's microphone device. By the way, i use Blackhole create a virtual input device.

To Reproduce

Steps to reproduce the behavior:

  1. Create a virtual device use Blackholehttps://github.com/ExistentialAudio/BlackHole
  2. Choose virtual input device created by Blackhole to record stream.
  3. Still record from default macos's microphone input device.
  4. See error

Expected behavior

Record from device that i choosen

Additional context There is blackhole's url https://github.com/ExistentialAudio/BlackHole

HydroCarbon avatar Mar 19 '24 02:03 HydroCarbon

And I found it always use the input device that setted in system setting. image

HydroCarbon avatar Mar 19 '24 03:03 HydroCarbon

@llfbandit is device selection an intended feature of the plugin?

austibwu avatar Apr 01 '24 07:04 austibwu

@llfbandit is device selection an intended feature of the plugin?

Record has a param of device.I think it's a param to select device. And document say it can choose device on macOS. 截图 2024-04-01 17-16-06

HydroCarbon avatar Apr 01 '24 09:04 HydroCarbon

@HydroCarbon Device selection was missing on streaming code branch.

Are you able to test it from this repository on master branch?

llfbandit avatar Apr 25 '24 15:04 llfbandit

@llfbandit OK,I will test it in two days. and I will reply to you .

HydroCarbon avatar Apr 28 '24 01:04 HydroCarbon

Released in record_darwin 1.1.0

llfbandit avatar May 21 '24 12:05 llfbandit