Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jitter on first play #3021

Closed
lukepighetti opened this issue Feb 7, 2024 · 3 comments
Closed

Jitter on first play #3021

lukepighetti opened this issue Feb 7, 2024 · 3 comments
Labels

Comments

@lukepighetti
Copy link
Contributor

FlameAudio.audioCache.loadAll(..) does not improve first play jitter

You have to play each of them with a volume of 0 to remove first play jitter

tick.m4a.zip

flame_audio: ^2.1.7
Flutter 3.16.8 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 67457e669f (3 weeks ago) • 2024-01-16 16:22:29 -0800
Engine • revision 6e2ea58a5c
Tools • Dart 3.2.5 • DevTools 2.28.5
import 'dart:developer';

import 'package:flame_audio/flame_audio.dart';

final $audio = AudioService();

class AudioService {
  Future<void> setup() async {
    final assets = ['tick.m4a'];

    await FlameAudio.audioCache.loadAll(assets);

    for (final x in assets) {
      // this is required to remove drift on first play, loadAll isn't enough
      FlameAudio.play(x, volume: 0);
    }

    log(name: 'audio', 'warmed up');
  }

  void playTick() => FlameAudio.play('tick.m4a');
}
@spydon
Copy link
Member

spydon commented Feb 7, 2024

Does this affect all platforms (part of the template you removed 😉)?

@spydon
Copy link
Member

spydon commented Feb 14, 2024

@lukepighetti?

@spydon
Copy link
Member

spydon commented May 27, 2024

Closing this since there was no reply.

@spydon spydon closed this as not planned Won't fix, can't repro, duplicate, stale May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants