public class WASAPIRenderer extends AbstractAudioRenderer<WASAPISystem>
audioSystem, dataFlow, JAVA_AUDIO_FORMAT_ENDIAN, NATIVE_AUDIO_FORMAT_ENDIAN
inputFormat
EMPTY_CONTROLS
Constructor and Description |
---|
WASAPIRenderer()
Initializes a new WASAPIRenderer instance which is to perform
playback (as opposed to sound a notification).
|
WASAPIRenderer(AudioSystem.DataFlow dataFlow)
Initializes a new WASAPIRenderer instance which is to either
perform playback or sound a notification.
|
WASAPIRenderer(boolean playback)
Initializes a new WASAPIRenderer instance which is to either
perform playback or sound a notification.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
java.lang.String |
getName() |
javax.media.Format[] |
getSupportedInputFormats()
Overrides the super implementation to handle the case in which the user
has selected "none" for the playback/notify device.
|
static javax.media.Codec |
maybeOpenResampler(javax.media.format.AudioFormat inFormat,
javax.media.format.AudioFormat outFormat)
Attempts to initialize and open a new Codec to resample media
data from a specific input AudioFormat into a specific output
AudioFormat.
|
void |
open() |
protected void |
playbackDevicePropertyChange(java.beans.PropertyChangeEvent ev)
Notifies this instance that the value of the property of
AbstractAudioRenderer.audioSystem which identifies the default notification or
playback (as determined by AbstractAudioRenderer.dataFlow ) device has changed. |
static int |
pop(byte[] array,
int arrayLength,
int length)
Pops a specific number of bytes from (the head of) a specific array of
bytes.
|
int |
process(javax.media.Buffer buffer) |
javax.media.Format |
setInputFormat(javax.media.Format format)
Sets the Format of the media data to be rendered by this
Renderer.
|
void |
start() |
void |
stop() |
getControls, getGainControl, getLocator, setLocator, setVolumeControl, useAudioThreadPriority
reset, useThreadPriority
getControl, getControl, queryInterface, queryInterface
public WASAPIRenderer()
public WASAPIRenderer(AudioSystem.DataFlow dataFlow)
dataFlow
- AudioSystem.DataFlow#PLAYBACK
if the new instance
is to perform playback or AudioSystem.DataFlow#NOTIFY
if the new
instance is to sound a notificationpublic WASAPIRenderer(boolean playback)
playback
- true if the new instance is to perform playback
or false if the new instance is to sound a notificationpublic static javax.media.Codec maybeOpenResampler(javax.media.format.AudioFormat inFormat, javax.media.format.AudioFormat outFormat)
inFormat
- the AudioFormat in which the new instance is to
input media dataoutFormat
- the AudioFormat in which the new instance is to
output media datapublic static int pop(byte[] array, int arrayLength, int length)
array
- the array of byte from which the specified number
of bytes are to be poppedarrayLength
- the number of elements in array which contain
valid datalength
- the number of bytes to be popped from arraypublic void close()
close
in interface javax.media.PlugIn
close
in class AbstractAudioRenderer<WASAPISystem>
public java.lang.String getName()
public javax.media.Format[] getSupportedInputFormats()
getSupportedInputFormats
in interface javax.media.Renderer
getSupportedInputFormats
in class AbstractAudioRenderer<WASAPISystem>
public void open() throws javax.media.ResourceUnavailableException
open
in interface javax.media.PlugIn
open
in class AbstractAudioRenderer<WASAPISystem>
javax.media.ResourceUnavailableException
protected void playbackDevicePropertyChange(java.beans.PropertyChangeEvent ev)
AbstractAudioRenderer.audioSystem
which identifies the default notification or
playback (as determined by AbstractAudioRenderer.dataFlow
) device has changed. The
default implementation does nothing so extenders may safely not call back
to their AbstractAudioRenderer super.playbackDevicePropertyChange
in class AbstractAudioRenderer<WASAPISystem>
ev
- a PropertyChangeEvent which specifies details about
the change such as the name of the property and its old and new valuespublic int process(javax.media.Buffer buffer)
public javax.media.Format setInputFormat(javax.media.Format format)
setInputFormat
in interface javax.media.Renderer
setInputFormat
in class AbstractRenderer<javax.media.format.AudioFormat>
format
- the Format of the media data to be rendered by
this Rendererpublic void start()
public void stop()
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.