Changes between Initial Version and Version 1 of Sound_engine


Ignore:
Timestamp:
Feb 23, 2008, 4:19:00 AM (16 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Sound_engine

    v1 v1  
     1overview
     2--------
     3
     4this module provides a moderately high-level sound interface. basic usage
     5is opening a sound and requesting it be played; it is closed automatically
     6when playback has finished (fire and forget).
     7any number of sound play requests may be issued; the most 'important' ones
     8are actually played (necessary due to limited hardware mixing capacity).
     93d positional sounds (heard to emanate from a given spot) are supported.
     10active sound instances are referenced by Handles (cf. [wiki:handle_manager h_mgr]), so changing volume etc.
     11during playback is possible (useful for fadeout).
     12
     13
     14sound setup
     15-----------
     16
     17OpenAL provides portable access to the underlying sound hardware, and
     18falls back to software mixing if no acceleration is provided.
     19we allow the user to specify the device to use (in case the default
     20has problems) and maximum number of sources (to reduce mixing cost).
     21
     22
     23performance
     24-----------
     25much effort has been invested in efficiency: all sound data is cached,
     26so every open() after the first is effectively free. large sound files are
     27streamed from disk to reduce load time and memory usage. hardware mixing
     28resources are suballocated to avoid delays when starting to play.
     29therefore, the user can confidently fire off hundreds of sound requests.
     30finally, lengthy initialization steps are delayed until the sound engine
     31is actually needed (i.e. upon first open()). perceived startup time is
     32therefore reduced - the user sees e.g. our main menu earlier.
     33
     34
     35terminology
     36-----------
     37
     38; hardware voice : refers to mixing resources on the DSP. strictly speaking, we mean 'OpenAL source', but this term is more clear. voice ~= source, unless expensive effects (e.g. EAX) are enabled. note: software mixing usually doesn't have a fixed 'source' cap.
     39; gain : is quantified volume. 1 is unattenuated, 0.5 corresponds to -6 dB, and 0 is silence. this can be set per-source as well as globally.
     40; position : of a sound is within the app's coordinate system, the orientation of which is passed to snd_update.
     41; importance : of a sound derives from the app-assigned priority (e.g. voiceover must not be skipped in favor of seagulls) and distance from the listener. it's calculated by our prioritizer.
     42; virtual source : denotes a sound play request issued by the app. this is in contrast to an actual AL source, which will be mixed into the output channel. the most important VSrc receive an al_src.
     43; sound instances : store playback parameters (e.g. position), and reference the (centrally cached) "sound data" that will be played.