The audio controller for Red5 Pro. All R5Stream's run through this controller for both recording and playback.
More...
Inherits Runnable, and IDataSource.
|
static R5AudioController | getInstance () |
|
static byte[] | downSampleMono (byte[] buffer, float inFreq, float outFreq) |
|
static int | integerFloorMax (float n) |
|
|
int | sampleRate = 8000 |
|
r5fl | cfo = null |
|
r5bl | mdo = null |
|
|
void | configureAudioCodec (MediaFormat format) |
|
void | initAudioTrack (int sampleRateIn, int channelsIn) |
|
void | nativeEncode (byte[] audio) |
|
|
volatile boolean | doRun = false |
|
int | sampRate |
|
The audio controller for Red5 Pro. All R5Stream's run through this controller for both recording and playback.
◆ BufferSize()
int com.red5pro.streaming.media.R5AudioController.BufferSize |
( |
| ) |
|
|
inline |
Minimum buffer size for AudioRecorder
- Returns
- buffer size for recorder
◆ getAudioSampleTime()
long com.red5pro.streaming.media.R5AudioController.getAudioSampleTime |
( |
| ) |
|
|
inline |
Get current recording stream time in MS
- Returns
- time in MS
◆ getHardwareEnabled()
boolean com.red5pro.streaming.media.R5AudioController.getHardwareEnabled |
( |
| ) |
|
|
inline |
Get Current hardware enable status
- Returns
- hardware status.
◆ getInstance()
static R5AudioController com.red5pro.streaming.media.R5AudioController.getInstance |
( |
| ) |
|
|
inlinestatic |
◆ getSDPTrack()
SDPTrack com.red5pro.streaming.media.R5AudioController.getSDPTrack |
( |
| ) |
|
|
inline |
Current SDP track for the AudioController
- Returns
◆ getStartTime()
long com.red5pro.streaming.media.R5AudioController.getStartTime |
( |
| ) |
|
|
inline |
Get Starting MS of stream
- Returns
- starting MS
◆ getStreamtimeMill()
double com.red5pro.streaming.media.R5AudioController.getStreamtimeMill |
( |
| ) |
|
|
inline |
Get current stream time for playback
- Returns
◆ isControllerRunning()
boolean com.red5pro.streaming.media.R5AudioController.isControllerRunning |
( |
| ) |
|
|
inline |
If the controller is currently processing audio (incoming or outgoing)
- Returns
- currently running or not.
◆ isPlaybackRunning()
boolean com.red5pro.streaming.media.R5AudioController.isPlaybackRunning |
( |
| ) |
|
|
inline |
If there is currently a playback stream running on the instance
- Returns
- if playback is running
◆ nativeEncode()
void com.red5pro.streaming.media.R5AudioController.nativeEncode |
( |
byte[] |
audio | ) |
|
|
inlineprotected |
Encode audio to the media codec
- Parameters
-
◆ setHardwareEnabled()
void com.red5pro.streaming.media.R5AudioController.setHardwareEnabled |
( |
boolean |
enable, |
|
|
Context |
context |
|
) |
| |
|
inline |
Enable or disable hardware VOIP settings. Effects vary per device, use cautiously! Must be set PRIOR to publisher starting.
- Parameters
-
enable | enable the hardware VOIP settings. |
context | Context for the hardware setup (Application Activity) |
◆ setPlaybackAudioHandler()
Sets a handler to receive and optionally manipulate the audio stream data coming in for playback before sending to output. Note, this now functions identically to the function of the same name in R5Stream
- Parameters
-
handler | Object which will receive the callback containing the outgoing array of audio samples. |
R5PlaybackAudioHandler.processAudioPlayback has these three paramaters: byte[] bytes - Array of samples of raw audio. This serves as both input and output, any modification to the array will modify the audio sent to the speakers int size - The number of samples in the array - analogous to using bytes.length double streamTimeMilliSeconds - The time since the stream began playing audio, in milliseconds
◆ setPlaybackGain()
boolean com.red5pro.streaming.media.R5AudioController.setPlaybackGain |
( |
float |
gain | ) |
|
|
inline |
Backward compatibility. Same as setVolume().
Set for deprecation in SDK release v5.0.0.
◆ setSDPTrack()
void com.red5pro.streaming.media.R5AudioController.setSDPTrack |
( |
SDPTrack |
track | ) |
|
|
inline |
Set the SDP track for the audio controller for publishing.
- Parameters
-
◆ setVolume()
boolean com.red5pro.streaming.media.R5AudioController.setVolume |
( |
float |
volume | ) |
|
|
inline |
Sets the volume for the current playback.
- Parameters
-
volume | The desired volume, from 0.0f - 1.0f. |
- Returns
- Flag of being able to apply the volume to the current audio track.
◆ StartController()
void com.red5pro.streaming.media.R5AudioController.StartController |
( |
| ) |
|
|
inline |
Start the AudioController instance. Called automatically by Red5 Pro.
◆ StartPlayback()
void com.red5pro.streaming.media.R5AudioController.StartPlayback |
( |
R5Stream |
stream | ) |
|
|
inline |
Start audio playback for a given stream. Called automatically by Red5 Pro.
- Parameters
-
stream | Stream to playback audio from. |
◆ StartRecording()
void com.red5pro.streaming.media.R5AudioController.StartRecording |
( |
R5Stream |
recordingStream, |
|
|
IDataSink |
handler |
|
) |
| |
|
inline |
Start a recording stream for Red5Pro. Called automatically by Red5 Pro.
- Parameters
-
recordingStream | Stream to record |
handler | datasink to drain too. |
◆ StopController()
void com.red5pro.streaming.media.R5AudioController.StopController |
( |
| ) |
|
|
inline |
Stop processing all audio both incoming and outgoing
◆ StopPlayback()
void com.red5pro.streaming.media.R5AudioController.StopPlayback |
( |
| ) |
|
|
inline |
Stop all audio playback. Called automatically by Red5 Pro.
◆ StopRecording()
void com.red5pro.streaming.media.R5AudioController.StopRecording |
( |
| ) |
|
|
inline |
Stop all recording and release recording device
◆ mode
The documentation for this class was generated from the following file:
- /Users/ankitashankhdhar/Documents/Red5/Git/infrared5/red5pro-core-streaming-library/android/src/main/java/com/red5pro/streaming/media/R5AudioController.java