Premium Only Content

How to play audio in flutter? | Play an Audio from Local Asset | Android Studio
✅✅ If you found this video useful then like this video
🖍Kindly Write your feedback in comments
=============================================
add audio players dependency in pubspec .yaml .
audioplayers: ^0.20.1
https://pub.dev/packages/audioplayers...
Create a folder named asset and put an audio file in it.
Open the pubspec.yaml file and add the folder location where the audio is.
assets:
- assets/
open the main.dart file and import the audioplayers package.
import 'package:audioplayers/audioplayers.dart';
Add a button and include the code to play the audio in the onpress event.
final player = AudioCache();
player.play('audiofile.wav');
Run and Click the button.
)) notice if you are using audioplayers: 1.0.1
use:
final player=AudioPlayer();
player.setSource(AssetSource('theme_01.mp3'));
-
LIVE
TwinGatz
2 hours ago🔴LIVE - Strike Out Saturday | CS2 | Counter-Strike 2 | New Subs = Case Opening
28 watching -
LIVE
Simulation and Exploration
4 hours agoHow well does this play on a controller? Future console players check this out!
68 watching -
LIVE
MrR4ger
6 hours agoTHE THREE SPLOOGES (THE RECKONING) - ACTIVE MATTER w/ AKAGUMO & TONYGAMING
35 watching -
1:25:04
Michael Franzese
4 hours agoJames Comey, Epstein Files Block, Tylenol | Michael Franzese Live
185K62 -
1:24:44
Winston Marshall
9 hours agoThe Hamas Hoax That Fooled The West...
19.2K20 -
LIVE
Grant Cardone
5 hours agoReal Estate Live Training
161 watching -
22:53
Jasmin Laine
1 day agoParliament ERUPTS After "WORST Decision EVER!"—Carney Left SPEECHLESS by SHOCKING Report
20K32 -
11:50
Mrgunsngear
1 day ago $5.89 earnedSteiner MPS Enclosed Red Dot: Better Than The ACRO P2? 🔴
20.7K14 -
1:27:55
Sarah Westall
20 hours agoSelecting World Leaders: Intelligence No Longer a Prerequisite w/ Martin Armstrong
28.3K9 -
14:23
Sideserf Cake Studio
6 hours ago $0.92 earnedMAKING A REAL GHOST CAKE OF KING BOO!
18.5K2