public class WZAudioDevice extends Object implements WZBroadcastAPI.AudioBroadcaster
Modifier and Type | Class and Description |
---|---|
static interface |
WZAudioDevice.AudioSampleListener |
Constructor and Description |
---|
WZAudioDevice() |
Modifier and Type | Method and Description |
---|---|
int |
getAudioSource()
Returns the actively configured input device for capturing audio
|
WZBroadcastConfig |
getBroadcastConfig()
Returns the configuration settings for an active broadcast session.
|
WZStatus |
getBroadcasterStatus()
Returns the status for a broadcast component
|
WZBroadcastConfig |
getSamplingConfig()
Get the configuration used for the audio sampler
|
WZStatus |
getStatus() |
boolean |
isAudioEnabled()
Indicates if a broadcast component is enabled or not
|
boolean |
isAudioPaused()
Indicates if a broadcast component is paused or not
|
boolean |
isMuted()
deprecated Use
isAudioPaused() |
boolean |
isSamplingAudio()
Indicates if audio samples are currently being read from the audio input device and passed along to sample listeners or not
|
WZStatus |
prepareForBroadcast(WZBroadcastConfig broadcastConfig)
This method is called to initialize each component of a broadcast.
|
void |
registerAudioSampleListener(WZAudioDevice.AudioSampleListener sampleListener)
Registers an audio sample listener to receive raw PCM audio samples
|
void |
setAudioEnabled(boolean enabled)
Set or unset the flag indicating that a broadcast component is enabled
|
void |
setAudioPaused(boolean paused)
Set or unset the flag indicating that a broadcast component is in a paused state
|
void |
setAudioSource(int audioSource)
Sets the actively configured input device for capturing audio.
|
void |
setMuted(boolean muted)
deprecated Use
setAudioPaused(boolean) |
void |
setSamplingConfig(WZBroadcastConfig samplingConfig)
Set the configuration used by the audio sampler
|
void |
startAudioSampler()
Starts the audio sampler to read sample from the audio input device to pass along to the registered sample listeners
|
void |
startAudioSampler(WZBroadcastConfig samplingConfig)
Starts the audio sampler with the specified audio configuration
|
WZStatus |
startBroadcasting()
This method is called on each broadcast component to begin a live streaming broadcast.
|
void |
stopAudioSampler()
Stops the audio sampler
|
WZStatus |
stopBroadcasting()
This method is called on each broadcast component to end a live streaming broadcast.
|
void |
unregisterAudioSampleListener(WZAudioDevice.AudioSampleListener sampleListener)
Unregisters a previously registered audio sample listener
|
public int getAudioSource()
android.media.MediaRecorder.AudioSource
public void setAudioSource(int audioSource)
audioSource
- An identifier for the active audio source. Possible values are those listed at android.media.MediaRecorder.AudioSource
.
The default value is MediaRecorder.AudioSource.CAMCORDER
. Note that setting this while audio is actively being captured
will have no effect until a new capture session is started. Setting this to an invalid value will cause an error to occur at session begin.public WZBroadcastConfig getSamplingConfig()
public void setSamplingConfig(WZBroadcastConfig samplingConfig)
samplingConfig
- the configuration used by the audio samplerpublic boolean isMuted()
isAudioPaused()
public void setMuted(boolean muted)
setAudioPaused(boolean)
public void registerAudioSampleListener(WZAudioDevice.AudioSampleListener sampleListener)
sampleListener
- an instance implementing the WZAudioDevice.AudioSampleListener
interfacepublic void unregisterAudioSampleListener(WZAudioDevice.AudioSampleListener sampleListener)
sampleListener
- an instance implementing the WZAudioDevice.AudioSampleListener
interfacepublic boolean isSamplingAudio()
public void startAudioSampler(WZBroadcastConfig samplingConfig)
samplingConfig
- a configuration specification whose audio properties will be usedpublic void startAudioSampler()
public void stopAudioSampler()
public WZBroadcastConfig getBroadcastConfig()
WZBroadcastAPI.Broadcaster
getBroadcastConfig
in interface WZBroadcastAPI.Broadcaster
public WZStatus getBroadcasterStatus()
WZBroadcastAPI.Broadcaster
getBroadcasterStatus
in interface WZBroadcastAPI.Broadcaster
public WZStatus getStatus()
getStatus
in interface WZBroadcastAPI.Broadcaster
public boolean isAudioEnabled()
WZBroadcastAPI.AudioBroadcaster
isAudioEnabled
in interface WZBroadcastAPI.AudioBroadcaster
public void setAudioEnabled(boolean enabled)
WZBroadcastAPI.AudioBroadcaster
setAudioEnabled
in interface WZBroadcastAPI.AudioBroadcaster
enabled
- true if the audio broadcast component should be enabled, false otherwisepublic boolean isAudioPaused()
WZBroadcastAPI.AudioBroadcaster
isAudioPaused
in interface WZBroadcastAPI.AudioBroadcaster
public void setAudioPaused(boolean paused)
WZBroadcastAPI.AudioBroadcaster
setAudioPaused
in interface WZBroadcastAPI.AudioBroadcaster
paused
- true if the audio broadcast component should be placed in a paused state, false otherwisepublic WZStatus prepareForBroadcast(WZBroadcastConfig broadcastConfig)
WZBroadcastAPI.Broadcaster
WZState.READY
or WZState.IDLE
and indicate the error in the status as well.prepareForBroadcast
in interface WZBroadcastAPI.Broadcaster
broadcastConfig
- The broadcast configurationWZState.READY
public WZStatus startBroadcasting()
WZBroadcastAPI.Broadcaster
WZState.RUNNING
or WZState.IDLE
and indicate the error in the status as wellstartBroadcasting
in interface WZBroadcastAPI.Broadcaster
WZState.RUNNING
public WZStatus stopBroadcasting()
WZBroadcastAPI.Broadcaster
WZState.IDLE
stopBroadcasting
in interface WZBroadcastAPI.Broadcaster
WZState.IDLE
© 2016 Wowza Media Systems, LLC. All rights reserved. Terms | Privacy | Trademarks | Legal