Package 

Class AudioPlayerController

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private final MutableStateFlow<AudioPlayerState> state
    • Constructor Summary

      Constructors 
      Constructor Description
      AudioPlayerController(AudioPlayer audioPlayer, Function1<Attachment, String> getRecordingUri)
    • Method Summary

      Modifier and Type Method Description
      final MutableStateFlow<AudioPlayerState> getState()
      final Unit resetAudio(Attachment attachment)
      final Unit togglePlayback(Attachment attachment) Plays or pauses a playable audio attachment: a voice recording or a regular audio file.
      final Unit changeSpeed(Attachment attachment)
      final Unit startSeek(Attachment attachment)
      final Unit seekTo(Attachment attachment, Float progress)
      final Unit play(Attachment attachment) Plays a playable audio attachment: a voice recording or a regular audio file.
      final Unit pause() Pauses the current audio recording.
      final Unit resume() Resumes the current audio recording.
      final Unit reset() Resets the current audio recording.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AudioPlayerController

        AudioPlayerController(AudioPlayer audioPlayer, Function1<Attachment, String> getRecordingUri)
    • Method Detail

      • togglePlayback

         final Unit togglePlayback(Attachment attachment)

        Plays or pauses a playable audio attachment: a voice recording or a regular audio file.

      • play

         final Unit play(Attachment attachment)

        Plays a playable audio attachment: a voice recording or a regular audio file.

        Parameters:
        attachment - The attachment to play.
      • pause

         final Unit pause()

        Pauses the current audio recording.

      • resume

         final Unit resume()

        Resumes the current audio recording.

      • reset

         final Unit reset()

        Resets the current audio recording.