llfbandit / record

Audio recorder from microphone to a given file path. No external dependencies, MediaRecorder is used for Android an AVAudioRecorder for iOS.
https://pub.dev/packages/record
243 stars 204 forks source link

In browser, is that only use stream ? beacuse i can't create file on web. #283

Closed junixapp closed 9 months ago

mellowcello77 commented 9 months ago

This question might not be clear, but valid. Using the location of a file in Flutter web is extremely hard to find a documented solution for.

llfbandit commented 9 months ago

Really? Here's the start method documentation. https://github.com/llfbandit/record/blob/d289492ca18e623c8b0ba3ffe799be81b0c04266/record/lib/src/record.dart#L41-L47

You can't use files on web platform, only blobs. This is why stop method returns the path of the audio recorded. The browser generates an internal URL to access the blob. You can use cross_file package to deal with blobs/files for cross platform.

AliKarimiENT commented 9 months ago

Hi there @llfbandit, Are you saying that we just need to pass the provided URL from the stop function to the cross-file loading method?

llfbandit commented 9 months ago

Yes.