audio_player_service.dart 553 B

1234567891011121314151617
  1. import 'dart:async';
  2. import 'package:flutter/foundation.dart';
  3. /// An abstract class that defines the contract for an audio playback service.
  4. abstract class AudioPlayerService {
  5. /// Tracks whether the LLM is currently speaking.
  6. ValueNotifier<bool> get isLLMSpeaking;
  7. /// Plays a stream of incoming audio chunks.
  8. Future<void> playIncomingAudio(Stream<Uint8List> audioStream);
  9. /// Stops any ongoing playback.
  10. Future<void> stopPlayback();
  11. /// Clears any buffered audio and stops immediate playback.
  12. Future<void> clearPlaybackQueue();
  13. }