public class AudioEndpointControl
extends java.lang.Object
Constructor and Description |
---|
AudioEndpointControl(long handle)
Constructor storing the pointer/address to the underlying native object
|
Modifier and Type | Method and Description |
---|---|
Sound |
addSoundFromFile(java.lang.String filePath,
AudioFileFormat fileFormat,
boolean repeat,
int pauseMs)
Load a sound from a file
Loads a sound from a file.
|
Sound |
addSoundFromMemory(byte[] data,
int length,
int sampleLen,
int frequency,
boolean repeat,
int pauseMs)
Load a sound from a memory buffer
Creates a sound structure and copies the provided samples into its buffers.
|
void |
addStatusListener(AudioEventsHandler value)
Adds audio events listener
|
java.util.List<AudioDevice> |
audioDevices()
Gets a list with all available audio devices
|
AudioRoutingEndpoint |
audioEndpoint()
Gets the configured audio routing endpoint to be used
!!!NOT MPLEMENTED!!! The ZDK does not provide a mean for controlling the audio routing!
|
void |
audioEndpoint(AudioRoutingEndpoint value)
Configures the audio routing endpoint to be used
!!!NOT MPLEMENTED!!! The ZDK does not provide a mean for controlling the audio routing!
|
AudioSourcePresetType |
audioSourcePreset()
Gets the configured Audio Source Recorder Preset
Currently used only for Android's OpenSLES, but this can change in the future.
|
void |
audioSourcePreset(AudioSourcePresetType value)
Configures the Audio Source Recorder Preset
Currently used only for Android's OpenSLES, but this can change in the future.
|
void |
dropStatusListener(AudioEventsHandler value)
Drops audio events listener
|
EchoCancellationType |
echoCancellation()
Gets the configured acoustic echo cancellation working mode
Default is enabled in software mode.
|
void |
echoCancellation(EchoCancellationType value)
Configures the acoustic echo cancellation working mode
Default is enabled in software mode.
|
boolean |
enableFixedSpeakerGain()
Enables or disables the fixed gain on the audio output
Enable or disable the fixed speaker gain confgured by setfixedSpeakerGain.
|
void |
enableFixedSpeakerGain(boolean value)
Enables or disables the fixed gain on the audio output
Enable or disable the fixed speaker gain confgured by setfixedSpeakerGain.
|
protected void |
finalize()
Ensures the underlying native object destruction
|
double |
fixedSpeakerGain()
Configures the fixed gain on the audio output
Configures the gain to be applied when the gain filter is enabled by enableFixedSpeakerGain.
|
void |
fixedSpeakerGain(double value)
Configures the fixed gain on the audio output
Configures the gain to be applied when the gain filter is enabled by enableFixedSpeakerGain.
|
float |
getAutomaticGainControlGain()
Gets the configured Automatic Gain Control (AGC) fixed gain
The additional fixed gain (defaults to 0.f) added when using SoftwareDigitalV2 or SoftwareHybrid mode.
|
AutomaticGainControlType |
getAutomaticGainControlMode()
Gets the configured Automatic Gain Control (AGC) filter working mode
Works on all platforms.
|
AudioDevice |
getCurrentInputDevice()
Gets the selected input audio device
|
AudioDevice |
getCurrentOutputDevice()
Gets the selected output audio device
|
AudioDevice |
getCurrentRingDevice()
Gets the selected ringing audio device
|
AudioDevice |
getDeviceByName(java.lang.String name)
Gets an audio device with the given name if exists, otherwise - nullptr
|
long |
handle()
Gets the pointer/address to the underlying native object
|
boolean |
highPassFilter()
Controls the High Pass filter
Enables or disables the High Pass filter.
|
void |
highPassFilter(boolean value)
Controls the High Pass filter
Enables or disables the High Pass filter.
|
Result |
hostApi(HostAPI value)
Configures the audio host API to be used
|
boolean |
micBoost()
Controls the microphone boost option
Enables or disables the microphone boost.
|
void |
micBoost(boolean value)
Controls the microphone boost option
Enables or disables the microphone boost.
|
double |
micLevel()
Gets the configured audio input/microphone level
The volume setting for the input device.
|
void |
micLevel(double value)
Configures the audio input/microphone level
The volume setting for the input device.
|
Result |
muteInput(boolean value)
Mute or unmute the input device/microphone
|
Result |
muteOutput(boolean value)
Mute or unmute the output device/speaker
|
boolean |
noiseSuppression()
Controls the Noise Suppression filter
Enables or disables the Noise Suppression filter.
|
void |
noiseSuppression(boolean value)
Controls the Noise Suppression filter
Enables or disables the Noise Suppression filter.
|
double |
outputLevel()
Gets the configured audio output level
The volume setting for the input device.
|
void |
outputLevel(double value)
Configures the audio output level
The volume setting for the input device.
|
float |
preAmplifier()
Controls the Pre Amplifier
Enables or disables the Pre Amplifier which amplifies the input signal before any other porcessing occurs.
|
void |
preAmplifier(float value)
Controls the Pre Amplifier
Enables or disables the Pre Amplifier which amplifies the input signal before any other porcessing occurs.
|
Result |
resampler(AudioResampler value)
Configures the audio resampler to be used
Selects the resampler to be used by the audio engine.
|
double |
ringLevel()
Gets the configured audio ringing level
The volume setting for the ringing device.
|
void |
ringLevel(double value)
Configures the audio ringing level
The volume setting for the ringing device.
|
Result |
setAutomaticGainControlMode(AutomaticGainControlType type,
float gain)
Configures the Automatic Gain Control (AGC) filter working mode
Works on all platforms.
|
Result |
setCallRecordingNotifySound(Sound sound,
AudioOutputDeviceType monitorDevice)
Sets the sound to be played over the current call on every recording start
Sets the sound to be played back to the remote peer(s) (instead of the microphone input) on every start of call recording.
|
Result |
setCurrentInputDevice(AudioDevice device)
Select the input audio device
|
Result |
setCurrentOutputDevice(AudioDevice device)
Select the output audio device
|
Result |
setCurrentRingDevice(AudioDevice device)
Select the ringing audio device
|
Result |
startPlayback(Sound sound,
AudioOutputDeviceType monitorDevice)
Starts playback over the current call
Starts playing back the sound to the remote peer(s) (if there are active calls) instead of the microphone input.
|
Result |
startSound(Sound sound,
AudioOutputDeviceType outputType)
Start playback of a sound
Start playing the sound on one of the two output devices (either the selected output device or the selected ringing device).
|
Result |
stopPlayback()
Stops any playback
Stops any playback and monitored sound immediately if there is such.
|
Result |
stopSound(Sound sound,
AudioOutputDeviceType outputType)
Stops playback of a sound
Stops playing the sound.
|
public AudioEndpointControl(long handle)
handle
- Pointer/address to the underlying native objectpublic long handle()
protected void finalize()
finalize
in class java.lang.Object
public AudioRoutingEndpoint audioEndpoint()
AudioRoutingEndpoint
public void audioEndpoint(AudioRoutingEndpoint value)
value
- The audio routing endpointAudioRoutingEndpoint
public double micLevel()
ringLevel
public void micLevel(double value)
value
- The volume setting for the input device between 0.0 and 1.0ringLevel
public double outputLevel()
ringLevel
public void outputLevel(double value)
value
- The volume setting for the output device between 0.0 and 1.0ringLevel
public double ringLevel()
outputLevel
public void ringLevel(double value)
value
- The volume setting for the ringing device between 0.0 and 1.0outputLevel
public EchoCancellationType echoCancellation()
EchoCancellationType
public void echoCancellation(EchoCancellationType value)
value
- The acoustic echo cancellation modeEchoCancellationType
public boolean highPassFilter()
public void highPassFilter(boolean value)
value
- public float preAmplifier()
public void preAmplifier(float value)
value
- The amount of the fixed gain done by the pre amplifier.public boolean noiseSuppression()
public void noiseSuppression(boolean value)
value
- public AudioSourcePresetType audioSourcePreset()
AudioSourcePresetType
public void audioSourcePreset(AudioSourcePresetType value)
value
- The audio source presetAudioSourcePresetType
public java.util.List<AudioDevice> audioDevices()
AudioDevice
public boolean micBoost()
public void micBoost(boolean value)
value
- public boolean enableFixedSpeakerGain()
fixedSpeakerGain
public void enableFixedSpeakerGain(boolean value)
value
- fixedSpeakerGain
public double fixedSpeakerGain()
enableFixedSpeakerGain
public void fixedSpeakerGain(double value)
value
- Gain in dBenableFixedSpeakerGain
public AutomaticGainControlType getAutomaticGainControlMode()
setAutomaticGainControlMode AutomaticGainControlType
public float getAutomaticGainControlGain()
setAutomaticGainControlMode
public Result setAutomaticGainControlMode(AutomaticGainControlType type, float gain)
type
- The AGC modegain
- The additional fixed gain added when using SoftwareDigitalV2 or SoftwareHybrid mode. It can have
values between 0.f and 49.f db. The value is positive but it is interpreted as negative.getAutomaticGainControlGain Result AutomaticGainControlType
public Result hostApi(HostAPI value)
value
- The host APIResult
public Result resampler(AudioResampler value)
value
- The audio resampler typeResult
public AudioDevice getDeviceByName(java.lang.String name)
name
- The name of the audio device to be retrievedAudioDevice
public AudioDevice getCurrentInputDevice()
AudioDevice
public Result setCurrentInputDevice(AudioDevice device)
device
- The input device to be selectedResult
public AudioDevice getCurrentOutputDevice()
AudioDevice
public Result setCurrentOutputDevice(AudioDevice device)
device
- The output device to be selectedResult
public AudioDevice getCurrentRingDevice()
AudioDevice
public Result setCurrentRingDevice(AudioDevice device)
device
- The ringing device to be selectedResult
public Sound addSoundFromMemory(byte[] data, int length, int sampleLen, int frequency, boolean repeat, int pauseMs)
data
- The samples to copylength
- Size of the data to be coppied in bytessampleLen
- Size of a sample in bytes (must be 2)frequency
- Frequency of the sound in Hz (must be 8000)repeat
- 1/TRUE if the sound should be looped when playedpauseMs
- If the sound is to be looped, the amount of silence in milliseconds between each loopAudioFileFormat addSoundFromFile
public Sound addSoundFromFile(java.lang.String filePath, AudioFileFormat fileFormat, boolean repeat, int pauseMs)
filePath
- Name of the file to load from, UTF-8fileFormat
- Type of the file to load from - !!!currently limited only to WAV!!!repeat
- 1/TRUE if the sound should be looped when playedpauseMs
- If the sound is to be looped, the amount of silence in milliseconds between each loopAudioFileFormat addSoundFromMemory
public Result startSound(Sound sound, AudioOutputDeviceType outputType)
sound
- The sound to be playedoutputType
- The output device to play the soundsetCurrentRingDevice addSoundFromFile addSoundFromMemory stopSound startPlayback
public Result stopSound(Sound sound, AudioOutputDeviceType outputType)
sound
- Sound to stop playingoutputType
- The output device to play the soundstartSound
public Result startPlayback(Sound sound, AudioOutputDeviceType monitorDevice)
sound
- The sound to play over the networkmonitorDevice
- Monitoring device - optional local output device to play the soundstopPlayback
public Result stopPlayback()
startPlayback
public Result setCallRecordingNotifySound(Sound sound, AudioOutputDeviceType monitorDevice)
sound
- The sound to play over the networkmonitorDevice
- Monitoring deviceaddSoundFromMemory startPlayback stopPlayback
public Result muteInput(boolean value)
value
- muteOutput
public Result muteOutput(boolean value)
value
- muteOutput
public void addStatusListener(AudioEventsHandler value)
value
- The audio events handlerAudioEventsHandler
public void dropStatusListener(AudioEventsHandler value)
value
- The audio events handlerAudioEventsHandler