public class ALAudioPlayer extends ALProxy
Constructor and Description |
---|
ALAudioPlayer(Session session) |
Modifier and Type | Method and Description |
---|---|
void |
clearStats() |
void |
exit()
Exits and unregisters the module.
|
java.lang.String |
getBrokerName()
Gets the name of the parent broker.
|
java.lang.Float |
getCurrentPosition(java.lang.Integer playId)
Returns the position in the file which is currently played
|
java.lang.Float |
getFileLength(java.lang.Integer playId)
Returns the length of the file played
|
java.util.List<java.lang.String> |
getInstalledSoundSetsList() |
java.util.List<java.lang.String> |
getLoadedFilesIds()
returns an array containing the Ids of the currently loaded files
|
java.util.List<java.lang.String> |
getLoadedFilesNames()
returns an array containing the names of the currently loaded files
|
java.util.List<java.lang.String> |
getLoadedSoundSetsList() |
java.lang.Float |
getMasterVolume()
Returns the master volume of the player
|
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.util.List<java.lang.String> |
getSoundSetFileNames(java.lang.String setName)
Return the list of files contained in a sound set
|
java.lang.String |
getUsage(java.lang.String name)
Gets the method usage string.
|
java.lang.Float |
getVolume(java.lang.Integer playId)
Returns the volume of the player
|
void |
goTo(java.lang.Integer playId,
java.lang.Float position)
Goes to a given position in a file which is playing.
|
java.lang.Boolean |
isRunning(java.lang.Integer id)
Returns true if the method is currently running.
|
java.lang.Boolean |
isSoundSetFileInstalled(java.lang.String setName,
java.lang.String soundName) |
java.lang.Boolean |
isSoundSetInstalled(java.lang.String setName) |
java.lang.Boolean |
isStatsEnabled() |
java.lang.Boolean |
isTraceEnabled() |
java.lang.Integer |
loadFile(java.lang.String fileName)
Loads a file for ulterior playback
|
void |
loadSoundSet(java.lang.String setName)
Load a sound set
|
void |
pause(java.lang.Integer id)
Pause a play back
|
java.lang.Boolean |
ping()
Just a ping.
|
void |
play(java.lang.Integer id)
Starts the playback of a file preloaded with the loadFile function.
|
void |
play(java.lang.Integer id,
java.lang.Float volume,
java.lang.Float pan)
Starts the playback of a file preloaded with the loadFile function, with specific volume and audio balance
|
void |
playFile(java.lang.String fileName)
Plays a wav or mp3 file
|
void |
playFile(java.lang.String fileName,
java.lang.Float volume,
java.lang.Float pan)
Plays a wav or mp3 file, with specific volume and audio balance
|
void |
playFileFromPosition(java.lang.String fileName,
java.lang.Float position)
Plays a wav or mp3 file from a given position in the file.
|
void |
playFileFromPosition(java.lang.String fileName,
java.lang.Float position,
java.lang.Float volume,
java.lang.Float pan)
Plays a wav or mp3 file from a given position in the file, with specific volume and audio balance
|
void |
playFileInLoop(java.lang.String fileName)
Plays a wav or mp3 file in loop
|
void |
playFileInLoop(java.lang.String fileName,
java.lang.Float volume,
java.lang.Float pan)
Plays a wav or mp3 file in loop, with specific volume and audio balance
|
void |
playInLoop(java.lang.Integer id)
Starts the playback in loop of a file preloaded with the loadFile function
|
void |
playInLoop(java.lang.Integer id,
java.lang.Float volume,
java.lang.Float pan)
Plays a wav or mp3 file in loop, with specific volume and audio balance
|
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.
|
void |
playSoundSetFile(java.lang.String fileName)
Plays a file contained in one of the sound sets loaded
|
void |
playSoundSetFile(java.lang.String fileName,
java.lang.Float position,
java.lang.Float volume,
java.lang.Float pan,
java.lang.Boolean loop)
Plays a file contained in a given sound set
|
void |
playSoundSetFile(java.lang.String soundSetName,
java.lang.String fileName)
Plays a file contained in a given sound set
|
void |
playSoundSetFile(java.lang.String soundSetName,
java.lang.String fileName,
java.lang.Float position,
java.lang.Float volume,
java.lang.Float pan,
java.lang.Boolean loop)
Plays a file contained in a given sound set
|
void |
playWebStream(java.lang.String streamName,
java.lang.Float param1,
java.lang.Float param2)
Starts the playback of a wab audio stream
|
void |
setMasterVolume(java.lang.Float volume)
Sets the master volume of the player
|
void |
setPanorama(java.lang.Float param1)
sets the audio panorama : -1 for left speaker / 1 for right speaker
|
void |
setVolume(java.lang.Integer id,
java.lang.Float volume)
Sets the volume of the player
|
void |
stop(java.lang.Integer id)
returns true if the method is currently running
|
void |
stopAll()
Stops all the files that are currently playing.
|
void |
unloadAllFiles()
unloads all the files already loaded.
|
void |
unloadFile(java.lang.Integer id)
unloads a file previously loaded with the loadFile function
|
void |
unloadSoundSet(java.lang.String setName)
Unload a sound set
|
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 ALAudioPlayer(Session session) throws java.lang.Exception
java.lang.Exception
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 playFile(java.lang.String fileName) throws CallError, java.lang.InterruptedException
fileName
- Path of the sound fileCallError
java.lang.InterruptedException
public void playFile(java.lang.String fileName, java.lang.Float volume, java.lang.Float pan) throws CallError, java.lang.InterruptedException
fileName
- Path of the sound filevolume
- volume of the sound file (must be between 0.0 and 1.0)pan
- audio balance of the sound file (-1.0 : left / 1.0 : right / 0.0 : centered)CallError
java.lang.InterruptedException
public void playSoundSetFile(java.lang.String fileName) throws CallError, java.lang.InterruptedException
fileName
- Name of the file without extensionCallError
java.lang.InterruptedException
public void playSoundSetFile(java.lang.String soundSetName, java.lang.String fileName) throws CallError, java.lang.InterruptedException
soundSetName
- Name of the soundsetfileName
- Name of the file without extensionCallError
java.lang.InterruptedException
public void playSoundSetFile(java.lang.String soundSetName, java.lang.String fileName, java.lang.Float position, java.lang.Float volume, java.lang.Float pan, java.lang.Boolean loop) throws CallError, java.lang.InterruptedException
soundSetName
- Name of the soundsetfileName
- Name of the file without extensionposition
- Position in second where the playing has to beginvolume
- volume of the sound file (must be between 0.0 and 1.0)pan
- audio balance of the sound file (-1.0 : left / 1.0 : right)loop
- specify if the file must be played in loopCallError
java.lang.InterruptedException
public void playSoundSetFile(java.lang.String fileName, java.lang.Float position, java.lang.Float volume, java.lang.Float pan, java.lang.Boolean loop) throws CallError, java.lang.InterruptedException
fileName
- Name of the file without extensionposition
- Position in second where the playing has to beginvolume
- volume of the sound file (must be between 0.0 and 1.0)pan
- audio balance of the sound file (-1.0 : left / 1.0 : right)loop
- specify if the file must be played in loopCallError
java.lang.InterruptedException
public void loadSoundSet(java.lang.String setName) throws CallError, java.lang.InterruptedException
setName
- name of the setCallError
java.lang.InterruptedException
public void unloadSoundSet(java.lang.String setName) throws CallError, java.lang.InterruptedException
setName
- name of the setCallError
java.lang.InterruptedException
public java.util.List<java.lang.String> getSoundSetFileNames(java.lang.String setName) throws CallError, java.lang.InterruptedException
setName
- name of the setCallError
java.lang.InterruptedException
public java.util.List<java.lang.String> getLoadedSoundSetsList() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public java.util.List<java.lang.String> getInstalledSoundSetsList() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public java.lang.Boolean isSoundSetInstalled(java.lang.String setName) throws CallError, java.lang.InterruptedException
setName
- name of the setCallError
java.lang.InterruptedException
public java.lang.Boolean isSoundSetFileInstalled(java.lang.String setName, java.lang.String soundName) throws CallError, java.lang.InterruptedException
setName
- name of the setsoundName
- name of the soundCallError
java.lang.InterruptedException
public void playFileInLoop(java.lang.String fileName) throws CallError, java.lang.InterruptedException
fileName
- Path of the sound fileCallError
java.lang.InterruptedException
public void playFileInLoop(java.lang.String fileName, java.lang.Float volume, java.lang.Float pan) throws CallError, java.lang.InterruptedException
fileName
- Path of the sound filevolume
- volume of the sound file (must be between 0.0 and 1.0)pan
- audio balance of the sound file (-1.0 : left / 1.0 : right)CallError
java.lang.InterruptedException
public void playFileFromPosition(java.lang.String fileName, java.lang.Float position) throws CallError, java.lang.InterruptedException
fileName
- Name of the sound fileposition
- Position in second where the playing has to beginCallError
java.lang.InterruptedException
public void playFileFromPosition(java.lang.String fileName, java.lang.Float position, java.lang.Float volume, java.lang.Float pan) throws CallError, java.lang.InterruptedException
fileName
- Name of the sound fileposition
- Position in second where the playing has to beginvolume
- volume of the sound file (must be between 0.0 and 1.0)pan
- audio balance of the sound file (-1.0 : left / 1.0 : right)CallError
java.lang.InterruptedException
public void goTo(java.lang.Integer playId, java.lang.Float position) throws CallError, java.lang.InterruptedException
playId
- Id of the process which is playing the fileposition
- Position in the file (in second)CallError
java.lang.InterruptedException
public void stopAll() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public void pause(java.lang.Integer id) throws CallError, java.lang.InterruptedException
id
- Id of the process that is playing the file you want to put in pauseCallError
java.lang.InterruptedException
public void setVolume(java.lang.Integer id, java.lang.Float volume) throws CallError, java.lang.InterruptedException
id
- Id of the process that is playing the file you want to put louder or less loudvolume
- Volume - range 0.0 to 1.0CallError
java.lang.InterruptedException
public void setMasterVolume(java.lang.Float volume) throws CallError, java.lang.InterruptedException
volume
- Volume - range 0.0 to 1.0CallError
java.lang.InterruptedException
public java.lang.Float getVolume(java.lang.Integer playId) throws CallError, java.lang.InterruptedException
playId
- Id of the process which is playing the fileCallError
java.lang.InterruptedException
public java.lang.Float getMasterVolume() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public void setPanorama(java.lang.Float param1) throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public java.lang.Integer loadFile(java.lang.String fileName) throws CallError, java.lang.InterruptedException
fileName
- Path of the sound file (either mp3 or wav)CallError
java.lang.InterruptedException
public void unloadFile(java.lang.Integer id) throws CallError, java.lang.InterruptedException
id
- Id returned by the loadFile functionCallError
java.lang.InterruptedException
public void unloadAllFiles() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public java.util.List<java.lang.String> getLoadedFilesNames() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public java.util.List<java.lang.String> getLoadedFilesIds() throws CallError, java.lang.InterruptedException
CallError
java.lang.InterruptedException
public void play(java.lang.Integer id) throws CallError, java.lang.InterruptedException
id
- Id returned by the loadFile functionCallError
java.lang.InterruptedException
public void play(java.lang.Integer id, java.lang.Float volume, java.lang.Float pan) throws CallError, java.lang.InterruptedException
id
- Id returned by the loadFile functionvolume
- volume of the sound file (must be between 0.0 and 1.0)pan
- audio balance of the sound file (-1.0 : left / 1.0 : right)CallError
java.lang.InterruptedException
public void playInLoop(java.lang.Integer id) throws CallError, java.lang.InterruptedException
id
- Id returned by the loadFile functionCallError
java.lang.InterruptedException
public void playInLoop(java.lang.Integer id, java.lang.Float volume, java.lang.Float pan) throws CallError, java.lang.InterruptedException
id
- Id returned by the loadFile functionvolume
- volume of the sound file (must be between 0.0 and 1.0)pan
- audio balance of the sound file (-1.0 : left / 1.0 : right)CallError
java.lang.InterruptedException
public void playWebStream(java.lang.String streamName, java.lang.Float param1, java.lang.Float param2) throws CallError, java.lang.InterruptedException
streamName
- Path of the web audio streamCallError
java.lang.InterruptedException
public java.lang.Float getFileLength(java.lang.Integer playId) throws CallError, java.lang.InterruptedException
playId
- Id of the process which is playing the fileCallError
java.lang.InterruptedException
public java.lang.Float getCurrentPosition(java.lang.Integer playId) throws CallError, java.lang.InterruptedException
playId
- Id of the process which is playing the fileCallError
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
Aldebaran SDK for Java
Copyright 2006-2015 Aldebaran Robotics. All Rights Reserved.