3

I'm building a flutter web app that has an audio play button. I've used both audioplayers and just_audio. They both worked perfectly in debug mode but they didn't work after deployment.

Here's my codes. I don't understand it. Can anyboy help me?

final ttsAudio = await getTTSAudio(text: line, lan: selectedLanMap[index]!, speakingRate: speakingRate);
final bytes = Base64Decoder().convert(ttsAudio, 0, ttsAudio.length);

final player = AudioPlayer();

final urlSource = UrlSource(Uri.dataFromBytes(bytes, mimeType:'audio/mpeg').toString());

await player.play(urlSource);

5
  • Does your app need to fetch data from the internet? In that case, have you setup the permission for internet access? If no, then this: stackoverflow.com/a/2169311/13625293 Commented Oct 23, 2023 at 13:07
  • I'm build a flutter web not android app. Do I need to set the permission for internet access? Commented Oct 23, 2023 at 13:14
  • My bad, didn't read that. No, my comment was about setting up permission for Android Commented Oct 23, 2023 at 13:24
  • 1
    I'm encountering this as well, just playing from assets also doesn't work, I'm using firebase to deploy Commented Feb 18, 2024 at 9:40
  • @YoungheeKim is your issue resolved, i also try to play audio from after record which give me blob url but it didnot work after deployment. Commented Aug 30, 2024 at 15:21

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.