initialiseAudioHandler method

Future<void> initialiseAudioHandler()

Initialises the audio service.

Implementation

Future<void> initialiseAudioHandler() async {
  if (_audioHandler != null) {
    return;
  }

  _audioHandler = await ag.AudioService.init<JidoujishoAudioHandler>(
    builder: () => JidoujishoAudioHandler(onPlayPause: () {
      _audioHandlerStreamController.add(null);
    }),
    config: const ag.AudioServiceConfig(
      androidNotificationChannelId: 'app.arianneorpilla.yuuna.channel.audio',
      androidNotificationChannelName: 'jidoujisho',
    ),
  );
}