Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changes between Version 25 and Version 26 of content/Sound


Ignore:
Timestamp:
Oct 14, 2009, 12:23:25 AM (15 years ago)
Author:
erwin
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • content/Sound

    v25 v26  
    22[[TracNav(TracNav/TOC_Development)]]
    33
    4 == User Guide ==
     4The sound subsytem is currently subject to heavy changes. For any questions, contact the devs directly.
    55
    6 === Configuring available sounds ===
    7 Configuration of soundfiles is done in the XML files. You just have to add the specific attribut to your class tag. The value has to be the filepath relative to the [mediapath]/audio directory.
    8 
    9 Current possible sounds:
    10 || '''Class''' || '''Soundattribute(s)''' || '''Looped?''' ||
    11 || Level || ambientsound || Yes ||
    12 || Engine || sound || Yes||
    13 
    14 Configuration of the mainmenu ambient sound is done in the config file, as the mainmenu loads no level.
    15 {{{
    16 [SoundMainMenu]
    17 filename_=<soundpath>
    18 }}}
    19 The soundpath is relative to the [mediapath]/audio directory, too. Default is ambient/mainmenu.wav.
    20 
    21 
    22 === Make more soundattributes available ===
    23 Here are some instructions:
    24  1. Look at the implementaion of the above classes. You should be able to copy a most of the things.
    25  1. Add a new XMLPort macro to the XMLPort function of the class the sound belongs to(most likely XMLPortLoadOnly), name the function loadFooSound or something similar
    26  1. Implement the load function, for some examples look at the above classes
    27  1. Add the needed members to the class (at least one SoundBase pointer)
    28  1. Add the calls to SondBase::play(bool loop) where you want to have the sound being played
    29  * Add the class/sound to the above list and that's it
    30 
    31 == Development ==
    32 Sound uses the [http://openal.org OpenAL library].
    33 
    34 === Classes ===
    35 
    36 SoundManager: <- Tickable
    37  * manages the OpenAL device and context
    38  * manages the listener position
    39  * updates all registred sounds every tick
    40 
    41 SoundBase:
    42  * base class for all sounds
    43  * manages OpenAL buffer and source
    44  * has to be attached to a WorldEntity
    45  * can load a sound sample form a file (via alut, all alut supported sound formats; via fallback handler, ogg vorbis files)
    46 
    47 SoundMainMenu: <- SoundBase, OrxonoxClass
    48  * used to load the configured mainmenu ambient sound
    49 
    50 === Future projects ===
    51  * implement sound device configuration
    52  * implement fallback loaders for other file types
    53  * implement streaming abilites for large files
    54  * implement context handling for multiple Levels/SoundManagers
     6There will be a new documentation ASAP.