Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HELP]: Web: Record to Stream #1141

Open
hagen00 opened this issue Jan 7, 2025 · 0 comments
Open

[HELP]: Web: Record to Stream #1141

hagen00 opened this issue Jan 7, 2025 · 0 comments
Labels
help wanted Extra attention is needed Not yet handled

Comments

@hagen00
Copy link

hagen00 commented Jan 7, 2025

Is there support for recording to a stream on web? I'm playing around with code as per below (just shots in the dark).

On web, it's not hitting the listen method, i.e not printing Adding to sink WEB. I've also played around with only calling toStream, but then I get a mismatch with initialiizing recordingDataController as StreamController<Uint8List>().

The record method is working fine on a native Android device.

Future<void> record() async {
    var webRecordingDataController = StreamController<List<Float32List>>();
    var recordingDataController = StreamController<Uint8List>();

    _mRecordingDataSubscription = recordingDataController.stream.listen((buffer) {
      print('Adding to sink--------- ');
      voiceChannel!.sink.add(buffer);
    });
    _mRecordingDataSubscription = webRecordingDataController.stream.listen((buffer) {
      print('Adding to sink WEB!!!!!!!!!!!!!!!!!---------');
      voiceChannel!.sink.add(buffer);
    });
    await mRecorder!.startRecorder(
      toStream: kIsWeb ? null : recordingDataController.sink,
      toStreamFloat32: kIsWeb ? webRecordingDataController.sink : null,
      codec: kIsWeb ? Codec.opusWebM : Codec.pcm16,
      numChannels: 1,
      sampleRate: 24000,
      bufferSize: 8192,
    );
  }

Anyone gotten recording to stream on web to work?

@hagen00 hagen00 added help wanted Extra attention is needed Not yet handled labels Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed Not yet handled
Projects
None yet
Development

No branches or pull requests

1 participant