public class ALAudioDevice extends ALProxy
Constructor and Description |
---|
ALAudioDevice(Session session) |
Modifier and Type | Method and Description |
---|---|
void |
clearStats() |
void |
closeAudioInputs()
Closes the audio device for capture.
|
void |
closeAudioOutputs()
Closes the audio device for playback. close the audio device for capture.
|
void |
disableEnergyComputation()
Disables the computation of the energy of each microphone signal
|
void |
enableEnergyComputation()
Enables the computation of the energy of each microphone signal
|
void |
exit()
Exits and unregisters the module.
|
void |
flushAudioOutputs()
Flush the audio device for playback. close the audio device for capture.
|
java.lang.String |
getBrokerName()
Gets the name of the parent broker.
|
java.lang.Float |
getFrontMicEnergy()
Returns the energy of the front microphone signal
|
java.lang.Float |
getLeftMicEnergy()
Returns the energy of the left microphone signal
|
java.lang.Object |
getMethodHelp(java.lang.String methodName)
Retrieves a method's description.
|
java.util.List<java.lang.String> |
getMethodList()
Retrieves the module's method list.
|
java.lang.Object |
getModuleHelp()
Retrieves the module's description.
|
java.lang.Integer |
getOutputVolume()
Gets the output sound level of the system.
|
java.lang.Integer |
getParameter(java.lang.String pParamName)
This method returns the specified internal parameter ('outputSampleRate' or 'inputBufferSize').
|
java.lang.Float |
getRearMicEnergy()
Returns the energy of the rear microphone signal
|
java.lang.Float |
getRightMicEnergy()
Returns the energy of the right microphone signal
|
java.lang.String |
getUsage(java.lang.String name)
Gets the method usage string.
|
java.lang.Boolean |
isAudioOutMuted()
check if loudspeakers are muted
|
java.lang.Boolean |
isInputClosed()
Allows to know if audio inputs are closed or not
|
java.lang.Boolean |
isOutputClosed()
Allows to know if audio ouputs are closed or not
|
java.lang.Boolean |
isRunning(java.lang.Integer id)
Returns true if the method is currently running.
|
java.lang.Boolean |
isStatsEnabled() |
java.lang.Boolean |
isTraceEnabled() |
void |
muteAudioOut(java.lang.Boolean param1)
mute the loudspeakers
|
void |
openAudioInputs()
Opens the audio device for capture.
|
void |
openAudioOutputs()
Opens the audio device for playback.
|
java.lang.Boolean |
ping()
Just a ping.
|
void |
playSine(java.lang.Integer frequence,
java.lang.Integer gain,
java.lang.Integer pan,
java.lang.Float duration)
Play a sine wave which specified caracteristics.
|
java.lang.Boolean |
sendLocalBufferToOutput(java.lang.Integer nbOfFrames,
java.lang.Integer pBuffer)
This function allows a local module to send sound onto the nao's loudpseakers
You must pass to this function a pointer to the stereo buffer to send, and the number of frames per channel.
|
java.lang.Boolean |
sendRemoteBufferToOutput(java.lang.Integer nbOfFrames,
java.lang.Object pBuffer)
This function allows a remote module to send sound onto the nao's loudpseakers
You must pass to this function the stereo buffer you want to send as an ALValue converted to binary, and the number of frames per channel.
|
void |
setClientPreferences(java.lang.String name,
java.lang.Integer sampleRate,
java.lang.Integer channelsConfiguration,
java.lang.Integer deinterleaved)
Set AudioDevice Client preferences
|
void |
setClientPreferences(java.lang.String name,
java.lang.Integer sampleRate,
java.lang.Object channelsVector,
java.lang.Integer deinterleaved,
java.lang.Integer timeStamp)
Set AudioDevice Client preferences.
|
void |
setFileAsInput(java.lang.String pFileName)
This method allows to send sound samples contained in a sound file at the input of ALAudioDevice, instead of the nao's microphones sound data.
|
void |
setOutputVolume(java.lang.Integer volume)
Sets the output sound level of the system.
|
void |
setParameter(java.lang.String pParamName,
java.lang.Integer pParamValue)
This method sets the specified internal parameter ('outputSampleRate' or 'inputBufferSize')
inputBufferSize can bet set to 8192 or 16384.
|
void |
startMicrophonesRecording(java.lang.String pFileName)
This method allows to record the signal collected on the nao's microphones.
|
void |
stop(java.lang.Integer id)
returns true if the method is currently running
|
void |
stopMicrophonesRecording()
This method stops the recording of the sound collected by the microphones.
|
void |
subscribe(java.lang.String pModule)
This function allows a module to subscribe to the ALAudioDevice module.For more informations see the audio part of the red documentation
|
void |
unsubscribe(java.lang.String pModule)
This function allows a module to subscribe to the ALAudioDevice module.For more informations see the audio part of the red documentation
|
java.lang.String |
version()
Returns the version of the module.
|
java.lang.Boolean |
wait(java.lang.Integer id,
java.lang.Integer timeoutPeriod)
Wait for the end of a long running method that was called using 'post'
|
call, connect, connect, disconnect, getNaoqiType, getService, isProxyReady, setService
public ALAudioDevice(Session session) throws java.lang.Exception
java.lang.Exception
public void flushAudioOutputs() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public void playSine(java.lang.Integer frequence, java.lang.Integer gain, java.lang.Integer pan, java.lang.Float duration) throws CallError, java.lang.InterruptedException
frequence
- Frequence in Hertzgain
- Volume Gain between 0 and 100pan
- Stereo Pan set to either {-1,0,+1}duration
- Duration of the sine wave in secondsCallError
java.lang.InterruptedException
public void enableEnergyComputation() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public java.lang.Boolean isInputClosed() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public java.lang.Float getLeftMicEnergy() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public java.lang.Float getRightMicEnergy() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public java.lang.Float getFrontMicEnergy() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public java.lang.Float getRearMicEnergy() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public void setClientPreferences(java.lang.String name, java.lang.Integer sampleRate, java.lang.Object channelsVector, java.lang.Integer deinterleaved, java.lang.Integer timeStamp) throws CallError, java.lang.InterruptedException
name
- name of the clientsampleRate
- sample rate of the microphones data sent to the processSound or processSoundRemote functions - must be 16000 or 48000channelsVector
- ALValue containing a vector of int indicating which microphones data will be send to the processSound or processSoundRemote functionsdeinterleaved
- indicates if the microphones data sent to the processSound or processSoundRemote functions are interleaved or not - 0 : interleaved - 1 : deinterleavedtimeStamp
- parameter indicating if audio timestamps are sent to the processSound or processSoundRemote functions - 0 : no - 1 : yesCallError
java.lang.InterruptedException
public void muteAudioOut(java.lang.Boolean param1) throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public java.lang.Boolean isAudioOutMuted() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public java.lang.Boolean isOutputClosed() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public void setClientPreferences(java.lang.String name, java.lang.Integer sampleRate, java.lang.Integer channelsConfiguration, java.lang.Integer deinterleaved) throws CallError, java.lang.InterruptedException
name
- name of the clientsampleRate
- sample rate of the microphones data sent to the process function - must be 16000 or 48000channelsConfiguration
- An int (defined in ALSoundExtractor) indicating which microphones data will be send to the process function. ALLCHANNELS, LEFTCHANNEL, RIGHTCHANNEL, FRONTCHANNEL, REARCHANNEL are the configuration currently supported.deinterleaved
- indicates if the microphones data sent to the process function are interleaved or not - 0 : interleaved - 1 : deinterleavedCallError
java.lang.InterruptedException
public void disableEnergyComputation() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public java.lang.Boolean isStatsEnabled() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public void clearStats() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public java.lang.Boolean isTraceEnabled() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public void exit() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public java.lang.String version() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public java.lang.Boolean ping() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public java.util.List<java.lang.String> getMethodList() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public java.lang.Object getMethodHelp(java.lang.String methodName) throws CallError, java.lang.InterruptedException
methodName
- The name of the method.CallError
java.lang.InterruptedException
public java.lang.Object getModuleHelp() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public java.lang.Boolean wait(java.lang.Integer id, java.lang.Integer timeoutPeriod) throws CallError, java.lang.InterruptedException
id
- The ID of the method that was returned when calling the method using 'post'timeoutPeriod
- The timeout period in ms. To wait indefinately, use a timeoutPeriod of zero.CallError
java.lang.InterruptedException
public java.lang.Boolean isRunning(java.lang.Integer id) throws CallError, java.lang.InterruptedException
id
- The ID of the method that was returned when calling the method using 'post'CallError
java.lang.InterruptedException
public void stop(java.lang.Integer id) throws CallError, java.lang.InterruptedException
id
- the ID of the method to wait forCallError
java.lang.InterruptedException
public java.lang.String getBrokerName() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public java.lang.String getUsage(java.lang.String name) throws CallError, java.lang.InterruptedException
name
- The name of the method.CallError
java.lang.InterruptedException
public void subscribe(java.lang.String pModule) throws CallError, java.lang.InterruptedException
pModule
- Name of the moduleCallError
java.lang.InterruptedException
public void unsubscribe(java.lang.String pModule) throws CallError, java.lang.InterruptedException
pModule
- Name of the moduleCallError
java.lang.InterruptedException
public java.lang.Boolean sendLocalBufferToOutput(java.lang.Integer nbOfFrames, java.lang.Integer pBuffer) throws CallError, java.lang.InterruptedException
nbOfFrames
- Number of 16 bits samples per channel to send.pBuffer
- Buffer to sendCallError
java.lang.InterruptedException
public java.lang.Boolean sendRemoteBufferToOutput(java.lang.Integer nbOfFrames, java.lang.Object pBuffer) throws CallError, java.lang.InterruptedException
nbOfFrames
- Number of 16 bits samples per channel to send.pBuffer
- Buffer to sendCallError
java.lang.InterruptedException
public void setFileAsInput(java.lang.String pFileName) throws CallError, java.lang.InterruptedException
pFileName
- Name of the input file.CallError
java.lang.InterruptedException
public void setParameter(java.lang.String pParamName, java.lang.Integer pParamValue) throws CallError, java.lang.InterruptedException
pParamName
- Name of the parameter to set ('outputSampleRate' or 'inputBufferSize').pParamValue
- The value to which the specified parameter should be set.CallError
java.lang.InterruptedException
public java.lang.Integer getParameter(java.lang.String pParamName) throws CallError, java.lang.InterruptedException
pParamName
- Name of the parameter to get ('outputSampleRate' or 'inputBufferSize').CallError
java.lang.InterruptedException
public void startMicrophonesRecording(java.lang.String pFileName) throws CallError, java.lang.InterruptedException
pFileName
- Name of the file where to record the sound.CallError
java.lang.InterruptedException
public void stopMicrophonesRecording() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public void setOutputVolume(java.lang.Integer volume) throws CallError, java.lang.InterruptedException
volume
- Volume [0-100].CallError
java.lang.InterruptedException
public java.lang.Integer getOutputVolume() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public void openAudioInputs() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public void openAudioOutputs() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public void closeAudioInputs() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public void closeAudioOutputs() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
Aldebaran SDK for Java
Copyright 2006-2015 Aldebaran Robotics. All Rights Reserved.