audio_waveforms icon indicating copy to clipboard operation
audio_waveforms copied to clipboard

Display waves and play content from web url like: https://example.com/example_audio.mp4

Open bulgarian-beast opened this issue 3 years ago • 26 comments

Hey guys, I love this project, could you explain me how to generate waves from an http audio url? I can't find any doc or example in the pub.dev link or by reading the sources.

To work around the problem I created a temporary file, but it would be nice to have a method to invoke fromUrl. I'm posting this code to help someone who would like to read voice messages from a database.

ElevatedButton(
    onPressed: () async {
        Response response = await get(Uri.parse(
            "https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3"));
        Uint8List bytes = response.bodyBytes;
        File file = File('${appDirectory.path}/audio1.mp3');

        if (response.statusCode == 200) {
              await file.writeAsBytes(bytes);
               playerController1.preparePlayer(file.path).then((value) {
                    if (mounted) {
                        setState(() {});
                    }
             });
       }
 },
child: Text("Buf url"),
 ),

Originally posted by @bulgarian-beast in https://github.com/SimformSolutionsPvtLtd/audio_waveforms/issues/20#issuecomment-1151189174

bulgarian-beast avatar Jun 09 '22 22:06 bulgarian-beast

This is really needed.

rlee1990 avatar Aug 19 '22 17:08 rlee1990

Any updates on this feature

Nader2004 avatar Oct 09 '22 08:10 Nader2004

this would be a great addition, any update?

kyleorin avatar Oct 16 '22 11:10 kyleorin

This is needed

bensonarafat avatar Feb 09 '23 10:02 bensonarafat

+1

geekswamp avatar Feb 15 '23 13:02 geekswamp

+1

arioul89 avatar Apr 02 '23 12:04 arioul89

This is absolutely needed, especially for Flutter web where dart:io is not available!

TheFreal avatar Apr 03 '23 21:04 TheFreal

+1 for sure

ikeremozcan avatar Apr 18 '23 14:04 ikeremozcan

still waiting for this update

saad0510 avatar Jun 28 '23 11:06 saad0510

+1

loic-hamdi avatar Sep 25 '23 03:09 loic-hamdi

+1

mthanhha avatar Oct 12 '23 10:10 mthanhha

+1

fabioselau077 avatar Oct 16 '23 19:10 fabioselau077

+1

liangzaifankun avatar Nov 02 '23 13:11 liangzaifankun

+1

Chappie74 avatar Nov 22 '23 02:11 Chappie74

+1

brukted avatar Nov 23 '23 11:11 brukted

+1

msnajib avatar Feb 27 '24 04:02 msnajib