Skip to content
This repository has been archived by the owner on Jul 21, 2022. It is now read-only.

Can't share audio #68

Open
FilipeOS opened this issue May 25, 2020 · 0 comments
Open

Can't share audio #68

FilipeOS opened this issue May 25, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@FilipeOS
Copy link

Hi there,

I'm developing an app (for myself and testing) that I'm able to record sound from mic and save it on a List<Uint8List> (using sound_stream plugin) and I think I'm doing something wrong.

To play all in list I do this:

void _play() async {
    await _player.start();

    if (_micChunks.isNotEmpty) {
      for (var chunk in _micChunks) {
        await _player.writeChunk(chunk);
      }
      //_micChunks.clear();
      _isPlaying = false;
    }
  }

And to share I'm trying to do this (share ONLY the last on list):

void _save() async {
    try {
      await Share.file(
          'Sound', 'custom_sound.mp3', _micChunks.last.buffer.asUint8List(), 'audio/*');
    } catch (e) {
      print('error: $e');
    }
  }

Any advise please? Thank you!

@FilipeOS FilipeOS added the bug Something isn't working label May 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant