# OnlyAudioBase

abstract class OnlyAudioBase

Wrapper to stream only audio. It is under tests. Created by pedro on 10/07/18.

#### Inheritors

GenericOnlyAudio
MultiOnlyAudio
RtmpOnlyAudio
RtspOnlyAudio
SrtOnlyAudio
UdpOnlyAudio

## Constructors

OnlyAudioBase
Link copied to clipboard
constructor()

## Functions

disableAudio
Link copied to clipboard
open fun disableAudio()
Mute microphone, can be called before, while and after stream.
enableAudio
Link copied to clipboard
open fun enableAudio()
Enable a muted microphone, can be called before, while and after stream.
forceCodecType
Link copied to clipboard
open fun forceCodecType(codecTypeAudio: CodecUtil.CodecType)
getRecordStatus
Link copied to clipboard
open fun getRecordStatus(): RecordController.Status
getStreamClient
Link copied to clipboard
abstract fun getStreamClient(): StreamBaseClient
isAudioMuted
Link copied to clipboard
open fun isAudioMuted(): Boolean
Get mute state of microphone.
isRecording
Link copied to clipboard
open fun isRecording(): Boolean
Get record state.
isStreaming
Link copied to clipboard
open fun isStreaming(): Boolean
Get stream state.
pauseRecord
Link copied to clipboard
open fun pauseRecord()
prepareAudio
Link copied to clipboard
open fun prepareAudio(): Boolean
Same to call: prepareAudio(64 * 1024, 32000, true, false, false);
open fun prepareAudio(bitrate: Int, sampleRate: Int, isStereo: Boolean): Boolean
open fun prepareAudio(bitrate: Int, sampleRate: Int, isStereo: Boolean, echoCanceler: Boolean, noiseSuppressor: Boolean): Boolean
open fun prepareAudio(audioSource: Int, bitrate: Int, sampleRate: Int, isStereo: Boolean, echoCanceler: Boolean, noiseSuppressor: Boolean): Boolean
Call this method before use @startStream.
resetAudioEncoder
Link copied to clipboard
open fun resetAudioEncoder(): Boolean
resumeRecord
Link copied to clipboard
open fun resumeRecord()
setAudioCodec
Link copied to clipboard
open fun setAudioCodec(codec: AudioCodec)
setCustomAudioEffect
Link copied to clipboard
open fun setCustomAudioEffect(customAudioEffect: CustomAudioEffect)
Set an audio effect modifying microphone's PCM buffer.
setEncoderErrorCallback
Link copied to clipboard
open fun setEncoderErrorCallback(encoderErrorCallback: CodecErrorCallback)
Set a callback to know errors related with Video/Audio encoders
setRecordController
Link copied to clipboard
open fun setRecordController(recordController: RecordController)
setTimestampMode
Link copied to clipboard
open fun setTimestampMode(timestampModeAudio: TimestampMode)
Set the mode to calculate timestamp.
startRecord
Link copied to clipboard
@RequiresApi(api = Build.VERSION_CODES.O)
open fun startRecord(@NonNull fd: FileDescriptor)
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR2)
open fun startRecord(path: String)
@RequiresApi(api = Build.VERSION_CODES.O)
open fun startRecord(@NonNull fd: FileDescriptor, @Nullable listener: RecordController.Listener)
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR2)
open fun startRecord(path: String, listener: RecordController.Listener)
Starts recording an AAC audio.
startStream
Link copied to clipboard
open fun startStream(url: String)
Need be called after @prepareVideo or/and @prepareAudio.
stopRecord
Link copied to clipboard
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR2)
open fun stopRecord()
Stop record AAC audio started with @startRecord.
stopStream
Link copied to clipboard
open fun stopStream()
Stop stream started with @startStream.