Skip to content

Commit

Permalink
Update rebuild script for audio_soloud
Browse files Browse the repository at this point in the history
  • Loading branch information
domesticmouse committed Nov 14, 2024
1 parent e85b6cc commit 19c4ad4
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions audio_soloud/codelab_rebuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,7 @@ steps:
final audioController = AudioController();
await audioController.initialize();

runApp(
MyApp(audioController: audioController),
);
runApp(MyApp(audioController: audioController));
}

class MyApp extends StatelessWidget {
Expand Down Expand Up @@ -507,8 +505,8 @@ steps:
- name: Play music loops
path: audio_soloud/lib/audio/audio_controller.dart
patch-u: |
--- a/lib/audio/audio_controller.dart
+++ b/lib/audio/audio_controller.dart
--- b/audio_soloud/step_05/lib/audio/audio_controller.dart
+++ a/audio_soloud/step_05/lib/audio/audio_controller.dart
@@ -8,6 +8,8 @@ class AudioController {

SoLoud? _soloud;
Expand All @@ -518,7 +516,7 @@ steps:
Future<void> initialize() async {
_soloud = SoLoud.instance;
await _soloud!.init();
@@ -27,11 +29,38 @@ class AudioController {
@@ -27,11 +29,40 @@ class AudioController {
}

Future<void> startMusic() async {
Expand All @@ -530,8 +528,10 @@ steps:
+ }
+ }
+ _log.info('Loading music');
+ final musicSource = await _soloud!
+ .loadAsset('assets/music/looped-song.ogg', mode: LoadMode.disk);
+ final musicSource = await _soloud!.loadAsset(
+ 'assets/music/looped-song.ogg',
+ mode: LoadMode.disk,
+ );
+ musicSource.allInstancesFinished.first.then((_) {
+ _soloud!.disposeSource(musicSource);
+ _log.info('Music source disposed');
Expand Down Expand Up @@ -594,9 +594,9 @@ steps:
- name: Apply effects
path: audio_soloud/lib/audio/audio_controller.dart
patch-u: |
--- a/lib/audio/audio_controller.dart
+++ b/lib/audio/audio_controller.dart
@@ -64,10 +64,12 @@ class AudioController {
--- b/audio_soloud/step_06/lib/audio/audio_controller.dart
+++ a/audio_soloud/step_06/lib/audio/audio_controller.dart
@@ -66,10 +66,12 @@ class AudioController {
}

void applyFilter() {
Expand Down

0 comments on commit 19c4ad4

Please sign in to comment.