-
- All Implemented Interfaces:
-
io.elevenlabs.audio.AudioManager
public final class NoOpAudioManager implements AudioManager
No-op AudioManager used by transports that do not capture or play audio (e.g., the WebSocket text-only transport).
Returning true from hasAudioPermission keeps callers that gate work on permission from short-circuiting; the recording/playback methods are intentionally inert.
-
-
Constructor Summary
Constructors Constructor Description NoOpAudioManager()
-
Method Summary
Modifier and Type Method Description UnitstartRecording()Start recording from the microphone UnitstopRecording()Stop recording from the microphone UnitstartPlayback()Start audio playback for incoming audio UnitstopPlayback()Stop audio playback UnitsetMicMuted(Boolean muted)Set the microphone mute state UnitsetMicrophoneMuted(Boolean muted)Mute the microphone at the OS/track level BooleanisMuted()Check if the microphone is currently muted UnitsetVolume(Float volume)Set the playback volume FloatgetVolume()Get the current playback volume BooleanhasAudioPermission()Check if audio recording permission is granted BooleanisRecording()Check if audio recording is currently active BooleanisPlaying()Check if audio playback is currently active UnitsetAudioStateListener(AudioStateListener listener)Set listener for audio state changes Unitcleanup()Clean up audio resources Should be called when audio management is no longer needed -
-
Method Detail
-
startRecording
Unit startRecording()
Start recording from the microphone
-
stopRecording
Unit stopRecording()
Stop recording from the microphone
-
startPlayback
Unit startPlayback()
Start audio playback for incoming audio
-
stopPlayback
Unit stopPlayback()
Stop audio playback
-
setMicMuted
Unit setMicMuted(Boolean muted)
Set the microphone mute state
- Parameters:
muted- true to mute microphone, false to unmute
-
setMicrophoneMuted
Unit setMicrophoneMuted(Boolean muted)
Mute the microphone at the OS/track level
- Parameters:
muted- true to mute, false to unmute
-
setVolume
Unit setVolume(Float volume)
Set the playback volume
- Parameters:
volume- Volume level from 0.0 (silent) to 1.
-
hasAudioPermission
Boolean hasAudioPermission()
Check if audio recording permission is granted
-
isRecording
Boolean isRecording()
Check if audio recording is currently active
-
setAudioStateListener
Unit setAudioStateListener(AudioStateListener listener)
Set listener for audio state changes
- Parameters:
listener- Callback for audio state events
-
-
-
-