-
public final 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 UnitresetAudio(Attachment attachment)final UnittogglePlayback(Attachment attachment)Plays or pauses a playable audio attachment: a voice recording or a regular audio file. final UnitchangeSpeed(Attachment attachment)final UnitstartSeek(Attachment attachment)final UnitseekTo(Attachment attachment, Float progress)final Unitplay(Attachment attachment)Plays a playable audio attachment: a voice recording or a regular audio file. final Unitpause()Pauses the current audio recording. final Unitresume()Resumes the current audio recording. final Unitreset()Resets the current audio recording. -
-
Constructor Detail
-
AudioPlayerController
AudioPlayerController(AudioPlayer audioPlayer, Function1<Attachment, String> getRecordingUri)
-
-
Method Detail
-
getState
final MutableStateFlow<AudioPlayerState> getState()
-
resetAudio
final Unit resetAudio(Attachment attachment)
-
togglePlayback
final Unit togglePlayback(Attachment attachment)
Plays or pauses a playable audio attachment: a voice recording or a regular audio file.
-
changeSpeed
final Unit changeSpeed(Attachment attachment)
-
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.
-
-
-
-