Opened 12 years ago

Last modified 12 years ago

#1223 closed enhancement

New Sound System — at Initial Version

Reported by: Kieran P Owned by:
Priority: Must Have Milestone: Alpha 11
Component: Core engine Keywords: patch
Cc: Patch:

Description

We need a new sound system, that works on Windows, Linux and Mac. Optionally also works on Android systems, so design with cross-device in mind (wrappers, apis etc), but focus on the operating systems first before mobile platforms.

The new sound system needs support for music and sound clips, and should work on both the main menu and ingame. The same system should handle things like background music, button clicks, ambient noise etc.

Details

Terminology: 'stack' (collection of tracks), 'track' (object linked to the 'target' sound to be played)

The sound system should support multiple stacks. A stack can be unlimited in size, or can have a limit. If a limit is set, when a new track is added and the limit of the stack is reached, that track is discarded.

Stacks are worked through concurrently (multi-threaded?), playing through their tracks in order of priority. If a track has 'async' set to false, the stack waits until the tracks target finishes playing before it moves to the next track. If the track has 'async' set to true, the target starts playing, and the stack moves right onto the track, without waiting for the previous one to finish.

TODO: Describe priorities, describe fade between tracks, describe gain adjustment on zooming, describe gain adjustment on distance from center screen

Basic JSON representation

{
  "1": {
    "limit": 5,
    "tracks": [
      { "target": "chop.wav", "async": true },
      { "target": "mine.wav", "async": true },
      { "target": "chop.wav", "async": true },
    ]
  },
  "2": {
    "limit": null,
    "tracks": [
      { "target": "peace1.wav", "async": false, "priority": 2 },
      { "target": "peace2.wav", "async": false, "priority": 2 },
      { "target": "war1.wav", "async": false, "priority": 1 }
    ]
  }
}

Change History (0)

Note: See TracTickets for help on using tickets.