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

Recording data in safari #388

Closed
dhiren8391 opened this issue Aug 24, 2024 · 2 comments
Closed

Recording data in safari #388

dhiren8391 opened this issue Aug 24, 2024 · 2 comments

Comments

@dhiren8391
Copy link

final path = await recorder!.stop();
final data = await fetchAudioData(path);

I tried both below functions. Every time I get 44 bytes in data. How do we get recorded audio bytes to pass in API for Safari browser?

Future<Uint8List> fetchAudioData(String url) async {
  html.HttpRequest request =
      await html.HttpRequest.request(url, responseType: 'arraybuffer');

  return Uint8List.view(request.response);
  // return Uint8List(0);
}

Future<Uint8List> fetchAudioData1(String blobUrl) async {
  final response = await html.window.fetch(blobUrl);
  final blob = await response.blob();
  final reader = html.FileReader();

  final completer = Completer<Uint8List>();
  reader.onLoadEnd.listen((event) {
    completer.complete(reader.result as Uint8List);
  });
  reader.readAsArrayBuffer(blob);
  return completer.future;
}
@llfbandit
Copy link
Owner

Please fill a simple reproducer with your recording configuration.
Also, does it work in Chrome or Firefox?
You could also try to confirm with the example project.

I guess the 44 bytes could be translated to string to check if safari provides an error from this content.

llfbandit added a commit that referenced this issue Aug 27, 2024
@llfbandit
Copy link
Owner

Released in record_web 1.1.3
Given encoder was not honored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants