Changes between Version 1 and Version 2 of Ticket #1223


Ignore:
Timestamp:
Mar 19, 2012, 5:11:54 AM (12 years ago)
Author:
Kieran P
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #1223 – Description

    v1 v2  
    99Terminology: 'stack' (collection of 'tracks' on a 'queue'), 'track' (object linked to the 'target' sound to be played)
    1010
    11 The sound system should support multiple named stacks. A new track can be added to any named stack. Stacks are worked through concurrently (multi-threaded?), playing through their tracks in order of first priority, then the order the track was added to the queue.
     11The sound system should support multiple named stacks. A new track can be added to any named stack. Stacks are worked through concurrently (multi-threaded?), playing through their tracks first in order of priority, then the order the track was added to the queue.
    1212
    13 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, the stack simply discards the track that was added. This prevent many async sounds piling up and running all at once (like 100 soldiers moving, which should not create a giant "KA-THUNK" when they move).
     13If a track of high priority comes into the stack, the current sound should fade out, and the priority one should fade in, then fade back to the one it was playing (requires the system have a 'pause' for tracks so that they can resume from the spot they were stopped, rather than restarting). More on track fading later.
    1414
    15 If a track has 'async' set to false, the stack waits until the tracks target finishes playing before popping the track off the queue and initiating the next track. If the track has 'async' set to true, the target starts playing, the stack pops the track right away, and moves onto the next track, without waiting for the previous one to finish.
     15A stack can be unlimited in size, or can have a limit. Default is unlimited. If a limit is set, when a new track is added and the limit of the stack is reached and a track of lower priority doesn't exist to replace, the stack simply discards the track that was added. This prevent many async sounds piling up and running all at once (like 100 soldiers moving, which should not create a giant "KA-THUNK" when they move).
    1616
    17 '''TODO:''' Describe stack clearing, Describe fade between tracks, Describe gain adjustment on zooming, Describe gain adjustment on distance from center screen
     17If a stack has 'async' set to false, the stack waits until each tracks target finishes playing before popping the track off the queue and initiating the next track (useful for music). If the stack has 'async' set to true, the tracks target starts playing and the stack pops the track right away, and moves onto the next track. Default is async true.
     18
     19For music in particular, we don't want it stopping suddenly and starting the next one instantly. So if a track has a fadeIn value, this is the amount of milliseconds that a volume should go from 0% to 100%. If another track is playing, the same time is used to fadeOut the playing track. The default is no fading (for things like quick unit actions, button clicks, etc).
     20
     21'''TODO:''' Describe fade between tracks, Describe gain adjustment on zooming, Describe gain adjustment on distance from center screen
    1822
    1923'''Basic JSON representation'''
     
    2125{{{
    2226{
    23   "unit_actions": {
     27  "actions": {
    2428    "limit": 10,
     29    "async": true,
    2530    "tracks": [
    26       { "target": "chop.wav", "async": true },
    27       { "target": "mine.wav", "async": true },
    28       { "target": "chop.wav", "async": true },
    29       { "target": "chop.wav", "async": true },
    30       { "target": "mine.wav", "async": true }
     31      { "target": "chop.wav" },
     32      { "target": "mine.wav" },
     33      { "target": "chop.wav" },
     34      { "target": "chop.wav" },
     35      { "target": "mine.wav" }
    3136    ]
    3237  },
    33   "ambient_noise": {
    34     "limit": 20,
     38  "ambient": {
     39    "limit": 10,
     40    "async": true,
    3541    "tracks": [
    36       { "target": "tree_falls.wav", "async": true },
    37       { "target": "fish_splash.wav", "async": true }
    38       { "target": "tree_falls.wav", "async": true },
    39       { "target": "tree_falls.wav", "async": true }
     42      { "target": "tree_falls.wav" },
     43      { "target": "fish_splash.wav" },
     44      { "target": "tree_falls.wav" },
     45      { "target": "tree_falls.wav" }
    4046    ]
    4147  },
    4248  "music": {
    4349    "limit": null,
     50    "async": false,
    4451    "tracks": [
    45       { "target": "peace1.wav", "async": false, "priority": 2 }, # this would play second
    46       { "target": "peace2.wav", "async": false, "priority": 2 }, # this would play third
    47       { "target": "war1.wav", "async": false, "priority": 1 }      # this would play first
     52      { "target": "peace1.wav", "priority": 2, fadeIn: 1500 }, # this would play second
     53      { "target": "peace2.wav", "priority": 2, fadeIn: 1500 }, # this would play third
     54      { "target": "war1.wav", "priority": 1, fadeIn: 750 }    # this would play first
    4855    ]
    4956  }