Skip to content

Commit

Permalink
Merge pull request #14 from GachiLord/fix/android-sound-effect
Browse files Browse the repository at this point in the history
Fix/android sound effect
  • Loading branch information
GachiLord authored Jun 10, 2024
2 parents 3bc7de4 + c824044 commit e699959
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/logic/state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,8 @@ class PlayerState extends ChangeNotifier {
/// Should be called only once
void _sequenceObserver() async {
await for (final _ in _player.currentIndexStream) {
// apply effects
_soundEffect();
// update ui
notifyListeners();
}
Expand Down
1 change: 1 addition & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ void main() async {
JustAudioMediaKit.title = 'pffs';
}
var player = audio.AudioPlayer();
player.setSkipSilenceEnabled(true);
final session = await AudioSession.instance;
await session.configure(const AudioSessionConfiguration.music());
// init state
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 0.0.5+1
version: 0.0.6+1

environment:
sdk: '>=3.3.4 <4.0.0'
Expand Down

0 comments on commit e699959

Please sign in to comment.