[{"data":1,"prerenderedAt":531},["ShallowReactive",2],{"doc-global_essentials\u002Fresources\u002Faudio":3},{"id":4,"title":5,"body":6,"description":520,"extension":521,"meta":522,"navigation":526,"path":527,"seo":528,"stem":529,"__hash__":530},"docs\u002Fdocs\u002Fglobal_essentials\u002Fresources\u002Faudio.md","Audio",{"type":7,"value":8,"toc":504},"minimark",[9,14,27,63,66,69,72,118,124,129,164,169,202,206,209,231,237,239,242,245,285,292,296,328,332,364,366,370,373,375,379,430,432,436,486,488,492],[10,11,13],"h1",{"id":12},"audio-system","Audio System",[15,16,17,18,22,23,26],"p",{},"The audio system handles ",[19,20,21],"strong",{},"music"," (background tracks) and ",[19,24,25],{},"sounds"," (effects).",[28,29,30,43],"table",{},[31,32,33],"thead",{},[34,35,36,40],"tr",{},[37,38,39],"th",{},"Type",[37,41,42],{},"Behavior",[44,45,46,55],"tbody",{},[34,47,48,52],{},[49,50,51],"td",{},"Music",[49,53,54],{},"Forms a playlist, plays random tracks in loop",[34,56,57,60],{},[49,58,59],{},"Sound",[49,61,62],{},"Plays files in sequence, once",[64,65],"hr",{},[67,68,51],"h2",{"id":21},[15,70,71],{},"Music entries contain multiple track files. When you set music, the system:",[28,73,74,84],{},[31,75,76],{},[34,77,78,81],{},[37,79,80],{},"Step",[37,82,83],{},"What happens",[44,85,86,94,102,110],{},[34,87,88,91],{},[49,89,90],{},"1",[49,92,93],{},"Shuffles all tracks randomly",[34,95,96,99],{},[49,97,98],{},"2",[49,100,101],{},"Plays the first track",[34,103,104,107],{},[49,105,106],{},"3",[49,108,109],{},"When track ends, plays next in shuffled order",[34,111,112,115],{},[49,113,114],{},"4",[49,116,117],{},"When all played, reshuffles and loops",[15,119,120,123],{},[19,121,122],{},"Fade transition:"," When changing music, the current track fades out over ~1 second before the new music starts.",[125,126,128],"h3",{"id":127},"playing-music","Playing Music",[28,130,131,141],{},[31,132,133],{},[34,134,135,138],{},[37,136,137],{},"Action",[37,139,140],{},"Description",[44,142,143,154],{},[34,144,145,151],{},[49,146,147],{},[148,149,150],"code",{},"{music: \"music_id\"}",[49,152,153],{},"Play music by ID",[34,155,156,161],{},[49,157,158],{},[148,159,160],{},"{music: false}",[49,162,163],{},"Use dungeon's default music",[15,165,166],{},[19,167,168],{},"Example:",[28,170,171,180],{},[31,172,173],{},[34,174,175,178],{},[37,176,177],{},"Trigger",[37,179,137],{},[44,181,182,192],{},[34,183,184,187],{},[49,185,186],{},"Enter boss room",[49,188,189],{},[148,190,191],{},"{music: \"boss_battle\"}",[34,193,194,197],{},[49,195,196],{},"Leave dungeon",[49,198,199],{},[148,200,201],{},"{music: \"overworld\"}",[125,203,205],{"id":204},"default-dungeon-music","Default Dungeon Music",[15,207,208],{},"Set default music in the dungeon template config:",[28,210,211,220],{},[31,212,213],{},[34,214,215,218],{},[37,216,217],{},"Field",[37,219,140],{},[44,221,222],{},[34,223,224,228],{},[49,225,226],{},[148,227,21],{},[49,229,230],{},"Music ID to play when entering this dungeon",[15,232,233,234,236],{},"When ",[148,235,160],{}," is used, the system reverts to the dungeon's configured music.",[64,238],{},[67,240,241],{"id":25},"Sounds",[15,243,244],{},"Sound entries can contain multiple files. When you play a sound, the system:",[28,246,247,255],{},[31,248,249],{},[34,250,251,253],{},[37,252,80],{},[37,254,83],{},[44,256,257,264,271,278],{},[34,258,259,261],{},[49,260,90],{},[49,262,263],{},"Loads all sound files",[34,265,266,268],{},[49,267,98],{},[49,269,270],{},"Plays first file",[34,272,273,275],{},[49,274,106],{},[49,276,277],{},"When it ends, plays the next",[34,279,280,282],{},[49,281,114],{},[49,283,284],{},"Continues until all files played",[15,286,287,288,291],{},"Sounds play ",[19,289,290],{},"in sequence"," (one after another), not simultaneously.",[125,293,295],{"id":294},"playing-sounds","Playing Sounds",[28,297,298,306],{},[31,299,300],{},[34,301,302,304],{},[37,303,137],{},[37,305,140],{},[44,307,308,318],{},[34,309,310,315],{},[49,311,312],{},[148,313,314],{},"{sound: \"sound_id\"}",[49,316,317],{},"Play a sound effect",[34,319,320,325],{},[49,321,322],{},[148,323,324],{},"{sound: \"sound1, sound2\"}",[49,326,327],{},"Play multiple sounds in sequence",[15,329,330],{},[19,331,168],{},[28,333,334,342],{},[31,335,336],{},[34,337,338,340],{},[37,339,177],{},[37,341,137],{},[44,343,344,354],{},[34,345,346,349],{},[49,347,348],{},"Player attacks",[49,350,351],{},[148,352,353],{},"{sound: \"sword_slash\"}",[34,355,356,359],{},[49,357,358],{},"Door unlocks",[49,360,361],{},[148,362,363],{},"{sound: \"key_turn, door_creak\"}",[64,365],{},[67,367,369],{"id":368},"volume","Volume",[15,371,372],{},"Volume is controlled by user settings via Menu.",[64,374],{},[67,376,378],{"id":377},"methods","Methods",[28,380,381,390],{},[31,382,383],{},[34,384,385,388],{},[37,386,387],{},"Method",[37,389,140],{},[44,391,392,401,411,421],{},[34,393,394,399],{},[49,395,396],{},[148,397,398],{},"game.setMusic(id)",[49,400,153],{},[34,402,403,408],{},[49,404,405],{},[148,406,407],{},"game.setMusic(false)",[49,409,410],{},"Use dungeon default music",[34,412,413,418],{},[49,414,415],{},[148,416,417],{},"game.playSounds(id)",[49,419,420],{},"Play sound effect",[34,422,423,428],{},[49,424,425],{},[148,426,427],{},"game.playSounds([id1, id2])",[49,429,327],{},[64,431],{},[67,433,435],{"id":434},"quick-reference","Quick Reference",[28,437,438,448],{},[31,439,440],{},[34,441,442,445],{},[37,443,444],{},"I want to...",[37,446,447],{},"Do this",[44,449,450,459,467,477],{},[34,451,452,455],{},[49,453,454],{},"Play background music",[49,456,457],{},[148,458,150],{},[34,460,461,463],{},[49,462,420],{},[49,464,465],{},[148,466,314],{},[34,468,469,472],{},[49,470,471],{},"Chain sound effects",[49,473,474],{},[148,475,476],{},"{sound: \"sound1, sound2, sound3\"}",[34,478,479,482],{},[49,480,481],{},"Reset to dungeon music",[49,483,484],{},[148,485,160],{},[64,487],{},[67,489,491],{"id":490},"next-steps","Next Steps",[493,494,495],"ul",{},[496,497,498,503],"li",{},[499,500,502],"a",{"href":501},"\u002Fdocs\u002Fglobal_essentials\u002Fresources\u002Fassets","Assets"," - Asset management",{"title":505,"searchDepth":506,"depth":506,"links":507},"",2,[508,513,516,517,518,519],{"id":21,"depth":506,"text":51,"children":509},[510,512],{"id":127,"depth":511,"text":128},3,{"id":204,"depth":511,"text":205},{"id":25,"depth":506,"text":241,"children":514},[515],{"id":294,"depth":511,"text":295},{"id":368,"depth":506,"text":369},{"id":377,"depth":506,"text":378},{"id":434,"depth":506,"text":435},{"id":490,"depth":506,"text":491},"The audio system handles music (background tracks) and sounds (effects).","md",{"plugin":523,"category":524,"page":525},"global_essentials","resources","audio",true,"\u002Fdocs\u002Fglobal_essentials\u002Fresources\u002Faudio",{"title":5,"description":520},"docs\u002Fglobal_essentials\u002Fresources\u002Faudio","2V6qhfNpg4XAEqUjqwUckoRIVZMUPzS0RBj9ygTmAxw",1779582261396]