|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ocap.hardware.device.AudioOutputPort
public class AudioOutputPort
Represents an individually controllable audio output port of the host device. A single instance of this class MAY represent the audio outputs for one or more video output ports depending upon the output port configuration of the device. If a host device is capable of outputting multiple AV streams to multiple output devices simultaneously, the device MAY have multiple instances of this class, each representing an individually controllable audio output.
The interpretation of audio gain measured in level and decibel
scales is as for javax.media.GainControl
.
The volume controlled via an instance of java.media.GainControl
,
if supported, SHALL be relative to the volume controlled by an appropriate
instance of AudioOutputPort
.
GainControl
,
HostSettings.getAudioOutputs()
,
HostSettings.setSystemVolumeKeyControl(boolean)
,
HostSettings.setSystemMuteKeyControl(boolean)
,
HostSettings.setSystemVolumeRange(int)
Field Summary | |
---|---|
static int |
COMPRESSION_HEAVY
Constant representing heavy audio level compression. |
static int |
COMPRESSION_LIGHT
Constant representing light audio level compression. |
static int |
COMPRESSION_MEDIUM
Constant representing medium audio level compression. |
static int |
COMPRESSION_NONE
Constant representing no audio compression. |
static int |
ENCODING_AC3
Constant representing AC3 digital audio encoding. |
static int |
ENCODING_DISPLAY
Constant representing a platform-selected digital audio encoding format. |
static int |
ENCODING_NONE
Constant representing lack of digital audio output. |
static int |
ENCODING_PCM
Constant representing pulse-code modulation (PCM) digital audio encoding. |
static int |
STEREO_MODE_MONO
Constant representing single channel (monoaural or mono) audio. |
static int |
STEREO_MODE_STEREO
Constant representing two-channel stereo audio. |
static int |
STEREO_MODE_SURROUND
Constant representing multi-channel stereo surround audio. |
Method Summary | |
---|---|
int |
getCompression()
Get the current audio level compression of the audio device. |
Enumeration |
getConnectedVideoOutputPorts()
Get the set of VideoOutputPort s whose audio is controlled by
this AudioOutputPort instance. |
float |
getDB()
Get the current gain set for this AudioOutputPort in decibels. |
int |
getEncoding()
Get the current encoding format for digital audio output for this audio device. |
float |
getLevel()
Get the current gain set for this AudioOutputPort
as a value between 0.0 and 1.0. |
float |
getMaxDB()
Get the maximum gain in decibels for this AudioOutputPort . |
float |
getMinDB()
Get the minimum gain in decibels for this AudioOutputPort . |
float |
getOptimalLevel()
Get the gain level that is optimal for stereo playback. |
int |
getStereoMode()
Get the current stereo mode of the audio device. |
int[] |
getSupportedCompressions()
Get the set of compression levels supported by this audio device. |
int[] |
getSupportedEncodings()
Get the set of encoding formats supported by this audio device. |
int[] |
getSupportedStereoModes()
Get the set of stereo modes supported by this audio device. |
boolean |
isLoopThru()
Get the current loop-thru setting of the audio device. |
boolean |
isMuted()
Get the mute state of the audio signal associated with this host. |
void |
setCompression(int compression)
Set the compression level of the audio device. |
float |
setDB(float db)
Set the gain in decibels for this AudioOutputPort . |
void |
setEncoding(int encoding)
Set the desired encoding format for digital audio output for this audio device. |
float |
setLevel(float level)
Set the gain using a floating point scale with values between 0.0 and 1.0. |
void |
setLoopThru(boolean loopthru)
Set the loop-thru setting for the audio device. |
void |
setMuted(boolean mute)
Mute or unmute the signal associated with this AudioOutputPort . |
void |
setStereoMode(int mode)
Set the stereo mode of the audio device. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int STEREO_MODE_MONO
public static final int STEREO_MODE_STEREO
public static final int STEREO_MODE_SURROUND
public static final int ENCODING_NONE
public static final int ENCODING_DISPLAY
public static final int ENCODING_PCM
public static final int ENCODING_AC3
public static final int COMPRESSION_NONE
public static final int COMPRESSION_LIGHT
public static final int COMPRESSION_MEDIUM
public static final int COMPRESSION_HEAVY
Method Detail |
---|
public int getStereoMode()
STEREO_MODE_MONO
,
STEREO_MODE_STEREO
or
STEREO_MODE_SURROUND
.setStereoMode(int)
,
getSupportedStereoModes()
public void setStereoMode(int mode) throws IllegalArgumentException, FeatureNotSupportedException
mode
- The desired stereo mode.
IllegalArgumentException
- if mode is not
one of STEREO_MODE_MONO
,
STEREO_MODE_STEREO
or
STEREO_MODE_SURROUND
FeatureNotSupportedException
- if the given setting is not supportedgetStereoMode()
,
getSupportedStereoModes()
public int[] getSupportedStereoModes()
FeatureNotSupportedException
when provided to setStereoMode(int)
.
setStereoMode(int)
,
getStereoMode()
public int getCompression()
COMPRESSION_NONE
,
COMPRESSION_LIGHT
,
COMPRESSION_MEDIUM
or
COMPRESSION_HEAVY
setCompression(int)
,
getSupportedCompressions()
public void setCompression(int compression) throws IllegalArgumentException, FeatureNotSupportedException
The compression levels correspond to implementation-specific ratios of input level to output gain. The following table describes the compression levels.
Level | Description |
---|---|
COMPRESSION_NONE |
Always a 1:1 ratio of input level to output gain. No compression is applied to the output signal |
COMPRESSION_LIGHT |
The lightest level of compression. Example ratio would be 2:1, where a 2dB change in input level is required to effect a 1dB change in output, above the threshold. |
COMPRESSION_MEDIUM |
An equal or higher level of compression than COMPRESSION_LIGHT |
COMPRESSION_HEAVY |
The highest level of compression. This may be a high enough level so as to be considered limiting. |
Other attributes of audio level compression (e.g., threshold, attack, and release) are implementation-specific and not exposed by this API.
compression
- The desired compression level.
IllegalArgumentException
- if compression is not
one of COMPRESSION_NONE
,
COMPRESSION_LIGHT
,
COMPRESSION_MEDIUM
or
COMPRESSION_HEAVY
FeatureNotSupportedException
- if the given setting is not supportedgetCompression()
,
getSupportedCompressions()
public int[] getSupportedCompressions()
FeatureNotSupportedException
when provided to setCompression(int)
.
setCompression(int)
,
getCompression()
public int getEncoding()
This method will never return ENCODING_DISPLAY
. Instead, the current
platform-selected encoding will be returned. The platform selects such an encoding
based upon the device connected to this audio output port.
ENCODING_NONE
,
ENCODING_PCM
or
ENCODING_AC3
setEncoding(int)
,
getSupportedEncodings()
public void setEncoding(int encoding) throws IllegalArgumentException, FeatureNotSupportedException
This method MAY be used to control the desired encoding format for digital audio output for this audio device. The following table describes the supported values for the encoding parameter:
Value | Description |
---|---|
ENCODING_PCM | Pulse code modulation digital audio encoding. |
ENCODING_AC3 | AC-3 digital audio encoding. |
ENCODING_DISPLAY | No explicit format is specified, instead the Host device will select the preferred output format. |
encoding
- The desired digital encoding format.
IllegalArgumentException
- if encoding is not
one of ENCODING_DISPLAY
,
ENCODING_PCM
or
ENCODING_AC3
FeatureNotSupportedException
- if the given setting is not supportedgetEncoding()
,
getSupportedEncodings()
public int[] getSupportedEncodings()
FeatureNotSupportedException
when provided to setEncoding(int)
.
setEncoding(int)
,
getEncoding()
public float getDB()
AudioOutputPort
in decibels.
setDB(float)
public float setDB(float db)
AudioOutputPort
.
Setting the gain to 0.0 (the default) implies that the audio
signal is neither amplified nor attenuated.
Positive values amplify the audio signal and negative values attenuate
the signal.
db
- The new gain in dB.
GainControl
,
getDB()
,
getMaxDB()
,
getMinDB()
,
setLevel(float)
public float getMaxDB()
AudioOutputPort
.
Calling setDB(float)
with values greater than those returned by this API
will have no effect.
public float getMinDB()
AudioOutputPort
.
Calling setDB(float)
with values less than those returned by this API
will have no effect.
public float getLevel()
AudioOutputPort
as a value between 0.0 and 1.0.
setLevel(float)
public float setLevel(float level)
AudioOutputPort
supports.
level
- The new gain value specified in the level scale.
GainControl
,
getLevel()
,
getDB()
,
setDB(float)
public float getOptimalLevel()
setLevel(float)
) will
reduce audio distortion on televisions that contain stereo decoders.
Where a fixed volume level is desired, it is recommended that the optimal level returned by this method be used.
setLevel(float)
public boolean isMuted()
true
if muted and false
otherwise.setMuted(boolean)
public void setMuted(boolean mute)
AudioOutputPort
.
Redundant invocations of this method are ignored.
The mute state does not effect the gain (as represented by getLevel()
or getDB()
.
mute
- The new mute state:
true
mutes the signal and false
unmutes the signal.isMuted()
public boolean isLoopThru()
true
if loop-thru is enabled and false
otherwise.setLoopThru(boolean)
public void setLoopThru(boolean loopthru) throws FeatureNotSupportedException
Audio loop-thru refers to a mechanism that allows audio from other devices
(e.g., DVD player or VCR) to connect to a home theater or TV through this
Host device when this AudioOutputPort
is otherwise not in use.
When loop-thru is enabled, audio inputs associated with this AudioOutputPort
will be routed through this AudioOutputPort
.
loopthru
- The new loop-thru state:
(true
enables loop-thru
and false
disables loop-thru.
FeatureNotSupportedException
- if the requested loop-thru setting can not
be achieved by the deviceisLoopThru()
public Enumeration getConnectedVideoOutputPorts()
VideoOutputPort
s whose audio is controlled by
this AudioOutputPort
instance.
VideoOutputPort
s as an Enumeration
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |