Sound
=====


**A simple sound actuator**


This actuator is a simple On/Off sound. Based on `Sound
<http://wiki.blender.org/index.php/Doc:2.6/Manual/Game_Engine/Logic/Actuators/Sound>`_
actuator.


.. cssclass:: properties morse-section

Configuration parameters for Sound
----------------------------------

*No configurable parameter.*

.. cssclass:: fields morse-section

Data fields
-----------


This actuator reads these datafields at each simulation step:

- ``mode`` (string, initial value: ``stop``)
	mode, enum in ['play','pause','stop']

*Interface support:*

(attention, no interface support!)

.. cssclass:: services morse-section

Services for Sound
------------------

- ``get_properties()`` (blocking)
    Returns the properties of a component.
    
    
  - Return value

    a dictionary of the current component's properties  

- ``set_property(prop_name, prop_val)`` (blocking)
    Modify one property on a component
    
    
  - Parameters

    - ``prop_name``: the name of the property to modify (as shown the documentation)
    - ``prop_val``: the new value of the property. Note that there is no checking about the type of the value so be careful

  - Return value

    nothing 

- ``get_configurations()`` (blocking)
    Returns the configurations of a component (parsed from the properties).
    
    
  - Return value

    a dictionary of the current component's configurations  



.. cssclass:: examples morse-section

Examples
--------


The following examples show how to use this component in a *Builder* script:

.. code-block:: python


    from morse.builder import *
    
    # adds a default robot (the MORSE mascott!)
    robot = Morsy()
    
    # creates a new instance of the actuator
    sound = Sound()

    # place your component at the correct location
    sound.translate(<x>, <y>, <z>)
    sound.rotate(<rx>, <ry>, <rz>)
    
    robot.append(sound)
    
    # define one or several communication interface, like 'socket'
    sound.add_interface(<interface>)

    env = Environment('empty')
    

.. cssclass:: files morse-section

Other sources of examples
+++++++++++++++++++++++++

- `Source code <../../_modules/morse/actuators/sound.html>`_
- `Unit-test <../../_modules/base/sound_testing.html>`_




*(This page has been auto-generated from MORSE module morse.actuators.sound.)*
