Changes between Version 1 and Version 2 of Ticket #1223
- Timestamp:
- Mar 19, 2012, 5:11:54 AM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #1223 – Description
v1 v2 9 9 Terminology: 'stack' (collection of 'tracks' on a 'queue'), 'track' (object linked to the 'target' sound to be played) 10 10 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 firstpriority, then the order the track was added to the queue.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 first in order of priority, then the order the track was added to the queue. 12 12 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).13 If 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. 14 14 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.15 A 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). 16 16 17 '''TODO:''' Describe stack clearing, Describe fade between tracks, Describe gain adjustment on zooming, Describe gain adjustment on distance from center screen 17 If 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 19 For 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 18 22 19 23 '''Basic JSON representation''' … … 21 25 {{{ 22 26 { 23 " unit_actions": {27 "actions": { 24 28 "limit": 10, 29 "async": true, 25 30 "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" } 31 36 ] 32 37 }, 33 "ambient_noise": { 34 "limit": 20, 38 "ambient": { 39 "limit": 10, 40 "async": true, 35 41 "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" } 40 46 ] 41 47 }, 42 48 "music": { 43 49 "limit": null, 50 "async": false, 44 51 "tracks": [ 45 { "target": "peace1.wav", " async": false, "priority": 2 },# this would play second46 { "target": "peace2.wav", " async": false, "priority": 2 },# this would play third47 { "target": "war1.wav", " async": false, "priority": 1 }# this would play first52 { "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 48 55 ] 49 56 }