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
Lofi Girl
2 years agoSynthwave Radio 🌌 - beats to chill/game to
285 watching -
4:34:26
Akademiks
5 hours agoICEMAN EPISODE 3
128K -
2:04:10
Inverted World Live
8 hours agoThe Robots Are Here | Ep. 103
58.4K13 -
1:21:53
Man in America
15 hours agoInflation, Debt & War: The 2032 Crash Cycle Is Here—Nations Will FALL w/ Martin Armstrong
50.6K19 -
1:53:48
Adam Does Movies
14 hours ago $2.37 earnedTalking Movies + Ask Me Anything - LIVE
20.7K2 -
2:55:43
TimcastIRL
7 hours agoTrump DOJ To Ban Trans People From Owning Guns After Catholic School Shooting | Timcast IRL
181K109 -
3:21:36
The Quartering
6 hours agoBaldur's Gate 3 First Playthrough!
46.5K8 -
6:34:42
Rallied
9 hours ago $7.39 earnedWarzone Solo Challenges
76.1K2 -
57:40
MattMorseTV
8 hours ago $10.91 earned🔴Trump just SHATTERED the RECORD.🔴
54.2K90 -
43:39
WickedVirtue
5 hours agoLate Night Spooky Plays
37K3