Classes | Functions | Variables
sound_play.libsoundplay Namespace Reference

Classes

class  Sound
 Class that publishes messages to the sound_play node. More...
 
class  SoundClient
 This class is a helper class for communicating with the sound_play node via the sound_play.SoundRequest message. More...
 

Functions

def _action_status_cb (self, msg)
 
def builtinSound (self, id, volume=1.0)
 Create a builtin Sound. More...
 
def play (self, **kwargs)
 Play the Sound. More...
 
def play (self, sound, volume=1.0, **kwargs)
 Play a buildin sound. More...
 
def playWave (self, sound, volume=1.0, **kwargs)
 Plays a WAV or OGG file. More...
 
def playWaveFromPkg (self, package, sound, volume=1.0, **kwargs)
 Plays a WAV or OGG file. More...
 
def repeat (self, **kwargs)
 Play the Sound repeatedly. More...
 
def repeat (self, text, volume=1.0, **kwargs)
 Say a string repeatedly. More...
 
def say (self, text, voice='', volume=1.0, **kwargs)
 Say a string. More...
 
def sendMsg (self, snd, cmd, s, arg2="", vol=1.0, replace=True, server_timeout=None, result_timeout=None, **kwargs)
 
def start (self, sound, volume=1.0, **kwargs)
 Play a buildin sound repeatedly. More...
 
def startWave (self, sound, volume=1.0, **kwargs)
 Plays a WAV or OGG file repeatedly. More...
 
def startWaveFromPkg (self, package, sound, volume=1.0, **kwargs)
 Plays a WAV or OGG file repeatedly. More...
 
def stop (self)
 Stop Sound playback. More...
 
def stop (self, sound)
 Stop playing a built-in sound. More...
 
def stopAll (self)
 Stop all currently playing sounds. More...
 
def stopSaying (self, text)
 Stop saying a string. More...
 
def stopWave (self, sound)
 Stop playing a WAV or OGG file. More...
 
def stopWaveFromPkg (self, sound, package)
 Stop playing a WAV or OGG file. More...
 
def voiceSound (self, s, volume=1.0)
 Create a voice Sound. More...
 
def waveSound (self, sound, volume=1.0)
 Create a wave Sound. More...
 

Variables

 _playing
 

Function Documentation

◆ _action_status_cb()

def sound_play.libsoundplay._action_status_cb (   self,
  msg 
)
private

Definition at line 370 of file libsoundplay.py.

◆ builtinSound()

def sound_play.libsoundplay.builtinSound (   self,
  id,
  volume = 1.0 
)

Create a builtin Sound.

Creates a Sound corresponding to indicated builtin wave.

Parameters
idIdentifier of the sound to play.

Definition at line 156 of file libsoundplay.py.

◆ play() [1/2]

def sound_play.libsoundplay.play (   self,
**  kwargs 
)

Play the Sound.

This method causes the Sound to be played once.

Definition at line 68 of file libsoundplay.py.

◆ play() [2/2]

def sound_play.libsoundplay.play (   self,
  sound,
  volume = 1.0,
**  kwargs 
)

Play a buildin sound.

Starts playing one of the built-in sounds. built-ing sounds are documented in SoundRequest.msg. Playback can be stopped by stopall.

Parameters
soundIdentifier of the sound to play.

Definition at line 276 of file libsoundplay.py.

◆ playWave()

def sound_play.libsoundplay.playWave (   self,
  sound,
  volume = 1.0,
**  kwargs 
)

Plays a WAV or OGG file.

Plays a WAV or OGG file once. The playback can be stopped by stopWave or stopAll.

Parameters
soundFilename of the WAV or OGG file. Must be an absolute path valid on the computer on which the sound_play node is running

Definition at line 198 of file libsoundplay.py.

◆ playWaveFromPkg()

def sound_play.libsoundplay.playWaveFromPkg (   self,
  package,
  sound,
  volume = 1.0,
**  kwargs 
)

Plays a WAV or OGG file.

Plays a WAV or OGG file once. The playback can be stopped by stopWaveFromPkg or stopAll.

Parameters
packagePackage name containing the sound file.
soundFilename of the WAV or OGG file. Must be an path relative to the package valid on the computer on which the sound_play node is running

Definition at line 241 of file libsoundplay.py.

◆ repeat() [1/2]

def sound_play.libsoundplay.repeat (   self,
**  kwargs 
)

Play the Sound repeatedly.

This method causes the Sound to be played repeatedly until stop() is called.

Definition at line 77 of file libsoundplay.py.

◆ repeat() [2/2]

def sound_play.libsoundplay.repeat (   self,
  text,
  volume = 1.0,
**  kwargs 
)

Say a string repeatedly.

The string is said repeatedly until stopSaying or stopAll is used.

Parameters
textString to say repeatedly

Definition at line 176 of file libsoundplay.py.

◆ say()

def sound_play.libsoundplay.say (   self,
  text,
  voice = '',
  volume = 1.0,
**  kwargs 
)

Say a string.

Send a string to be said by the sound_node. The vocalization can be stopped using stopSaying or stopAll.

Parameters
textString to say

Definition at line 166 of file libsoundplay.py.

◆ sendMsg()

def sound_play.libsoundplay.sendMsg (   self,
  snd,
  cmd,
  s,
  arg2 = "",
  vol = 1.0,
  replace = True,
  server_timeout = None,
  result_timeout = None,
**  kwargs 
)
Internal method that publishes the sound request, either directly as a
SoundRequest to the soundplay_node or through the actionlib interface
(which blocks until the sound has finished playing).

The blocking behavior is nominally the class-wide setting unless it has
been explicitly specified in the play call.

Definition at line 305 of file libsoundplay.py.

◆ start()

def sound_play.libsoundplay.start (   self,
  sound,
  volume = 1.0,
**  kwargs 
)

Play a buildin sound repeatedly.

Starts playing one of the built-in sounds repeatedly until stop or stopall is used. Built-in sounds are documented in SoundRequest.msg.

Parameters
soundIdentifier of the sound to play.

Definition at line 286 of file libsoundplay.py.

◆ startWave()

def sound_play.libsoundplay.startWave (   self,
  sound,
  volume = 1.0,
**  kwargs 
)

Plays a WAV or OGG file repeatedly.

Plays a WAV or OGG file repeatedly until stopWave or stopAll is used.

Parameters
soundFilename of the WAV or OGG file. Must be an absolute path valid on the computer on which the sound_play node is running.

Definition at line 212 of file libsoundplay.py.

◆ startWaveFromPkg()

def sound_play.libsoundplay.startWaveFromPkg (   self,
  package,
  sound,
  volume = 1.0,
**  kwargs 
)

Plays a WAV or OGG file repeatedly.

Plays a WAV or OGG file repeatedly until stopWaveFromPkg or stopAll is used.

Parameters
packagePackage name containing the sound file.
soundFilename of the WAV or OGG file. Must be an path relative to the package valid on the computer on which the sound_play node is running

Definition at line 253 of file libsoundplay.py.

◆ stop() [1/2]

def sound_play.libsoundplay.stop (   self)

Stop Sound playback.

This method causes the Sound to stop playing.

Definition at line 85 of file libsoundplay.py.

◆ stop() [2/2]

def sound_play.libsoundplay.stop (   self,
  sound 
)

Stop playing a built-in sound.

Stops playing a built-in sound started with play or start.

Parameters
soundSame sound that was used to start playback

Definition at line 295 of file libsoundplay.py.

◆ stopAll()

def sound_play.libsoundplay.stopAll (   self)

Stop all currently playing sounds.

This method stops all speech, wave file, and built-in sound playback.

Definition at line 302 of file libsoundplay.py.

◆ stopSaying()

def sound_play.libsoundplay.stopSaying (   self,
  text 
)

Stop saying a string.

Stops saying a string that was previously started by say or repeat. The argument indicates which string to stop saying.

Parameters
textSame string as in the say or repeat command

Definition at line 187 of file libsoundplay.py.

◆ stopWave()

def sound_play.libsoundplay.stopWave (   self,
  sound 
)

Stop playing a WAV or OGG file.

Stops playing a file that was previously started by playWave or startWave.

Parameters
soundSame string as in the playWave or startWave command

Definition at line 226 of file libsoundplay.py.

◆ stopWaveFromPkg()

def sound_play.libsoundplay.stopWaveFromPkg (   self,
  sound,
  package 
)

Stop playing a WAV or OGG file.

Stops playing a file that was previously started by playWaveFromPkg or startWaveFromPkg.

Parameters
packagePackage name containing the sound file.
soundFilename of the WAV or OGG file. Must be an path relative to the package valid on the computer on which the sound_play node is running

Definition at line 266 of file libsoundplay.py.

◆ voiceSound()

def sound_play.libsoundplay.voiceSound (   self,
  s,
  volume = 1.0 
)

Create a voice Sound.

Creates a Sound corresponding to saying the indicated text.

Parameters
sText to say

Definition at line 135 of file libsoundplay.py.

◆ waveSound()

def sound_play.libsoundplay.waveSound (   self,
  sound,
  volume = 1.0 
)

Create a wave Sound.

Creates a Sound corresponding to indicated file.

Parameters
sFile to play. Should be an absolute path that exists on the machine running the sound_play node.

Definition at line 144 of file libsoundplay.py.

Variable Documentation

◆ _playing

sound_play.libsoundplay._playing
private

Definition at line 372 of file libsoundplay.py.



sound_play
Author(s): Blaise Gassend
autogenerated on Fri Aug 16 2024 02:42:13