0 purchases
sound library
Features #
Easy and free 🆓 UI sounds library 🎶 for your general purposes 🎧 🔊
Getting started #
In the pubspec.yaml of your flutter project, add the following dependency:
dependencies:
...
sound_library: ^1.0.0
copied to clipboard
Add this import line
import 'package:sound_library/sound_library.dart';
copied to clipboard
Available sounds
Try out the sounds in the example project
Live example: Sounds Library
Name
Description
Click
General button click
Action
General action sound (Usually no user interaction)
Open
Open drawer, open menu, open popup, etc.
Deleted
Delete item, delete file, etc.
Welcome
Welcome sound
Success
Indicates success or completed action
Drag
Drag and drop sound
Intro
Intro sound
Add to cart
Add to cart sound
Close (Wood hit)
High pitched sound of two wood blocks
Order Complete
Order completed sound
Cashing machine
Cashing machine sound
Usage #
Play a sound with a volume level and position on the track
SoundPlayer.play(Sounds.click, volume: 0.5, position: Duration(milliseconds: 500);
copied to clipboard
Play a sound from the Sounds library
SoundPlayer.play(Sounds.click);
copied to clipboard
Play a sound from a URL path
SoundPlayer.playFromUrl(path);
copied to clipboard
Play a sound from a file path
SoundPlayer.playFromDeviceFilePath(file);
copied to clipboard
Play a sound from an asset path
SoundPlayer.playFromAssetPath(asset);
copied to clipboard
Play a sound from bytes
SoundPlayer.playFromBytes(bytes);
copied to clipboard
Check if audio is currently enabled
bool enabled = SoundPlayer.isAudioEnabled;
copied to clipboard
Check if audio is enabled on the device storage
This will also load the state from the device storage onto the isAudioEnabled property
bool enabled = await SoundPlayer.checkLocalStorageEnabled();
copied to clipboard
Enable/disable sounds
This will also save the state to the device storage
SoundPlayer.setAudioEnabled(true/false);
copied to clipboard
Additional information #
This package assumes corresponding permissions depending on platform.
Also, take a look at the example project for more information.
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.