Interface AudioRecordingController
-
- All Implemented Interfaces:
public interface AudioRecordingController
Controller given when entering audio recording mode.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interface
AudioRecordingController.AudioRecordingListener
Listener for audio recording events.
-
Method Summary
Modifier and Type Method Description abstract void
addAudioRecordingListener(@NonNull() AudioRecordingController.AudioRecordingListener listener)
Registers a AudioRecordingListener to get notified when audio recording state changes. abstract void
removeAudioRecordingListener(@NonNull() AudioRecordingController.AudioRecordingListener listener)
Removes a previously registered AudioRecordingListener. abstract AudioModeManager
getAudioModeManager()
Returns the audio mode manager from this controller. abstract void
resume()
Resumes recording. abstract void
pause()
Pauses recording. void
toggle()
Toggles recording. abstract boolean
isReady()
Checks whether the controller is ready for recording. abstract boolean
isResumed()
Checks whether the audio is currently recording. void
exitAudioRecordingMode()
Leaves recording mode and saves the recorded data. abstract void
exitAudioRecordingMode(boolean enterPlaybackModeAfterSaving)
Leaves recording mode and saves the recorded data. abstract void
discardRecording()
Discards recorded audio data. abstract int
getCurrentPosition()
Returns current recording position in milliseconds. abstract int
getRecordingTimeLimit()
Returns maximum recording time in milliseconds. abstract Flowable<ByteBuffer>
getVisualizerFlowable()
Returns flowable emitting recorded samples usable for audio visualizer. -
-
Method Detail
-
addAudioRecordingListener
abstract void addAudioRecordingListener(@NonNull() AudioRecordingController.AudioRecordingListener listener)
Registers a AudioRecordingListener to get notified when audio recording state changes. If the provider has been registered previously, this method will be a no-op.
- Parameters:
listener
- Listener to register.
-
removeAudioRecordingListener
abstract void removeAudioRecordingListener(@NonNull() AudioRecordingController.AudioRecordingListener listener)
Removes a previously registered AudioRecordingListener. If the provider hasn't been registered previously, this method will be a no-op.
- Parameters:
listener
- Listener to unregister.
-
getAudioModeManager
@NonNull() abstract AudioModeManager getAudioModeManager()
Returns the audio mode manager from this controller.
- Returns:
Audio mode manager.
-
resume
abstract void resume()
Resumes recording.
-
pause
abstract void pause()
Pauses recording.
-
toggle
void toggle()
Toggles recording.
-
isReady
abstract boolean isReady()
Checks whether the controller is ready for recording.
-
isResumed
abstract boolean isResumed()
Checks whether the audio is currently recording.
-
exitAudioRecordingMode
void exitAudioRecordingMode()
Leaves recording mode and saves the recorded data.
-
exitAudioRecordingMode
abstract void exitAudioRecordingMode(boolean enterPlaybackModeAfterSaving)
Leaves recording mode and saves the recorded data.
- Parameters:
enterPlaybackModeAfterSaving
-true
to enter playback mode after saving completes
-
discardRecording
abstract void discardRecording()
Discards recorded audio data.
-
getCurrentPosition
@IntRange(from = 0) abstract int getCurrentPosition()
Returns current recording position in milliseconds.
-
getRecordingTimeLimit
@IntRange(from = 0) abstract int getRecordingTimeLimit()
Returns maximum recording time in milliseconds.
-
getVisualizerFlowable
abstract Flowable<ByteBuffer> getVisualizerFlowable()
Returns flowable emitting recorded samples usable for audio visualizer.
- Returns:
Flowable emitting audio recording buffer on each read from the audio recorded.
-
-
-
-