Skip to content

Commit b4ac440

Browse files
authoredDec 18, 2023
feat: in-dialogue audio mixing (#101)
1 parent 903ba25 commit b4ac440

11 files changed

+221
-25
lines changed
 

‎.fmod/Metadata/Event/{0a76b8b2-dbb0-4b65-9e56-3d7593d4b8a1}.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@
264264
<value>15</value>
265265
</property>
266266
<property name="value">
267-
<value>-4</value>
267+
<value>-17</value>
268268
</property>
269269
<property name="curveShape">
270270
<value>0.271220326</value>
@@ -275,7 +275,7 @@
275275
<value>40</value>
276276
</property>
277277
<property name="value">
278-
<value>-60</value>
278+
<value>-63.3333359</value>
279279
</property>
280280
</object>
281281
<object class="Automator" id="{7c093201-51a8-442a-b134-1a2afdb8af5e}">

‎.fmod/Metadata/Event/{6520ac54-dc8e-4cdb-8923-ed09dddc0300}.xml

+131-8
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
<relationship name="parameters">
4646
<destination>{fcec1fc2-f924-4f55-af17-5c512029e925}</destination>
4747
<destination>{8b321c8d-2ac8-453c-917e-c2159ebf2f4c}</destination>
48+
<destination>{105634b3-3d04-45a5-90c8-91a57370c1e4}</destination>
4849
</relationship>
4950
<relationship name="banks">
5051
<destination>{87a1f613-fee9-4f55-8752-5c103c1c499c}</destination>
@@ -57,7 +58,9 @@
5758
</object>
5859
<object class="MasterTrack" id="{9a30c91e-b8c1-4dc5-b7c0-82761a9aa72d}">
5960
<relationship name="automationTracks">
61+
<destination>{eb744794-8750-4aca-aaf4-a36a815dd7f6}</destination>
6062
<destination>{af1ec916-2e0f-457b-90d2-a993665f38b6}</destination>
63+
<destination>{5056ec39-4927-4125-888f-26c61dd594dc}</destination>
6164
</relationship>
6265
<relationship name="modules">
6366
<destination>{2cc9c8be-b8bb-4616-95b1-7cfd513445a0}</destination>
@@ -228,10 +231,18 @@
228231
<destination>{3e513bc4-ccec-455b-874c-fc813741118a}</destination>
229232
</relationship>
230233
</object>
234+
<object class="ParameterProxy" id="{105634b3-3d04-45a5-90c8-91a57370c1e4}">
235+
<relationship name="preset">
236+
<destination>{52ea6d0d-0697-4f58-969d-25eda7cb3aac}</destination>
237+
</relationship>
238+
</object>
231239
<object class="EventMixerMaster" id="{88887c99-c7f2-4ca9-a725-2ddbb5d477f4}">
232240
<property name="volume">
233241
<value>-10.5</value>
234242
</property>
243+
<relationship name="automators">
244+
<destination>{56fc7d8f-aa61-4987-8014-1cb2351e64a6}</destination>
245+
</relationship>
235246
<relationship name="effectChain">
236247
<destination>{547c3f74-09be-425d-8d48-23a7dc08b6f3}</destination>
237248
</relationship>
@@ -242,11 +253,21 @@
242253
<destination>{71198fc1-e79f-45ca-af54-f5745a9061d1}</destination>
243254
</relationship>
244255
</object>
256+
<object class="AutomationTrack" id="{eb744794-8750-4aca-aaf4-a36a815dd7f6}">
257+
<relationship name="automator">
258+
<destination>{53ca2f94-a839-4bfa-bdeb-551da47f05be}</destination>
259+
</relationship>
260+
</object>
245261
<object class="AutomationTrack" id="{af1ec916-2e0f-457b-90d2-a993665f38b6}">
246262
<relationship name="automator">
247263
<destination>{35b48eb5-013a-4abd-baf8-a8652581b75c}</destination>
248264
</relationship>
249265
</object>
266+
<object class="AutomationTrack" id="{5056ec39-4927-4125-888f-26c61dd594dc}">
267+
<relationship name="automator">
268+
<destination>{56fc7d8f-aa61-4987-8014-1cb2351e64a6}</destination>
269+
</relationship>
270+
</object>
250271
<object class="TransitionSourceSound" id="{2cc9c8be-b8bb-4616-95b1-7cfd513445a0}">
251272
<property name="length">
252273
<value>0</value>
@@ -848,7 +869,7 @@
848869
</object>
849870
<object class="NamedMarker" id="{c1e09a5d-287a-4dad-9077-ec9d5e494c53}">
850871
<property name="position">
851-
<value>204.73684210526315</value>
872+
<value>213.01561465920446</value>
852873
</property>
853874
<property name="name">
854875
<value>Entry-Gate-Start</value>
@@ -1148,6 +1169,14 @@
11481169
<destination>{1342c44c-d4cd-47a0-8a8b-9971ce665418}</destination>
11491170
</relationship>
11501171
</object>
1172+
<object class="Automator" id="{56fc7d8f-aa61-4987-8014-1cb2351e64a6}">
1173+
<property name="nameOfPropertyBeingAutomated">
1174+
<value>volume</value>
1175+
</property>
1176+
<relationship name="automationCurves">
1177+
<destination>{93bb8347-f7bb-4738-9635-d3617eb36cc9}</destination>
1178+
</relationship>
1179+
</object>
11511180
<object class="MixerBusEffectChain" id="{547c3f74-09be-425d-8d48-23a7dc08b6f3}">
11521181
<relationship name="effects">
11531182
<destination>{bc684b9e-d1c6-4d45-954f-5eec2bfb1e5d}</destination>
@@ -1546,6 +1575,15 @@
15461575
<destination>{d846f806-f1dc-442f-bbad-d51bd096ad85}</destination>
15471576
</relationship>
15481577
</object>
1578+
<object class="AutomationCurve" id="{93bb8347-f7bb-4738-9635-d3617eb36cc9}">
1579+
<relationship name="parameter">
1580+
<destination>{52ea6d0d-0697-4f58-969d-25eda7cb3aac}</destination>
1581+
</relationship>
1582+
<relationship name="automationPoints">
1583+
<destination>{e1d12d8d-b9e2-4cb7-aed4-a317bcd40785}</destination>
1584+
<destination>{3cc9385a-b2f2-43d8-90b0-2484a2622083}</destination>
1585+
</relationship>
1586+
</object>
15491587
<object class="MixerBusFader" id="{bc684b9e-d1c6-4d45-954f-5eec2bfb1e5d}" />
15501588
<object class="MultibandEqEffect" id="{943fb735-4e39-4ed5-a3f6-3c76a32cb9a9}">
15511589
<property name="filterTypeA">
@@ -1557,8 +1595,11 @@
15571595
<property name="filterTypeC">
15581596
<value>9</value>
15591597
</property>
1598+
<property name="filterTypeD">
1599+
<value>7</value>
1600+
</property>
15601601
<property name="frequencyA">
1561-
<value>22</value>
1602+
<value>517.306396</value>
15621603
</property>
15631604
<property name="frequencyB">
15641605
<value>1100</value>
@@ -1583,6 +1624,7 @@
15831624
</property>
15841625
<relationship name="automators">
15851626
<destination>{35b48eb5-013a-4abd-baf8-a8652581b75c}</destination>
1627+
<destination>{53ca2f94-a839-4bfa-bdeb-551da47f05be}</destination>
15861628
</relationship>
15871629
</object>
15881630
<object class="AutomationPoint" id="{a4115363-3eee-4c47-8bd2-67a5d2e0ea3e}">
@@ -2004,12 +2046,37 @@
20042046
</relationship>
20052047
</object>
20062048
<object class="MixerBusFader" id="{099b4639-b546-4e10-b686-43c4871b5e49}" />
2049+
<object class="AutomationPoint" id="{e1d12d8d-b9e2-4cb7-aed4-a317bcd40785}">
2050+
<property name="position">
2051+
<value>0</value>
2052+
</property>
2053+
<property name="value">
2054+
<value>-10.5</value>
2055+
</property>
2056+
</object>
2057+
<object class="AutomationPoint" id="{3cc9385a-b2f2-43d8-90b0-2484a2622083}">
2058+
<property name="position">
2059+
<value>1</value>
2060+
</property>
2061+
<property name="value">
2062+
<value>-13</value>
2063+
</property>
2064+
</object>
20072065
<object class="Automator" id="{35b48eb5-013a-4abd-baf8-a8652581b75c}">
20082066
<property name="nameOfPropertyBeingAutomated">
20092067
<value>gainA</value>
20102068
</property>
20112069
<relationship name="automationCurves">
20122070
<destination>{1e838777-0f7b-4793-b66a-1dd993b37575}</destination>
2071+
<destination>{b1b4ec80-10e6-45f8-832c-92cbd8fb1e87}</destination>
2072+
</relationship>
2073+
</object>
2074+
<object class="Automator" id="{53ca2f94-a839-4bfa-bdeb-551da47f05be}">
2075+
<property name="nameOfPropertyBeingAutomated">
2076+
<value>gainD</value>
2077+
</property>
2078+
<relationship name="automationCurves">
2079+
<destination>{7dc452f1-8efe-45f6-9c61-f539c2a2bb73}</destination>
20132080
</relationship>
20142081
</object>
20152082
<object class="Automator" id="{bb11f8ed-b83c-4750-a575-572955e1275e}">
@@ -2106,6 +2173,24 @@
21062173
<destination>{1b886bda-60bb-4473-a7f9-2195b94b9861}</destination>
21072174
</relationship>
21082175
</object>
2176+
<object class="AutomationCurve" id="{b1b4ec80-10e6-45f8-832c-92cbd8fb1e87}">
2177+
<relationship name="parameter">
2178+
<destination>{52ea6d0d-0697-4f58-969d-25eda7cb3aac}</destination>
2179+
</relationship>
2180+
<relationship name="automationPoints">
2181+
<destination>{5ad2b906-3ee7-428e-ba37-128cd524c5a9}</destination>
2182+
<destination>{20767c01-21b7-4d57-b50c-d5c5f5e0b117}</destination>
2183+
</relationship>
2184+
</object>
2185+
<object class="AutomationCurve" id="{7dc452f1-8efe-45f6-9c61-f539c2a2bb73}">
2186+
<relationship name="parameter">
2187+
<destination>{52ea6d0d-0697-4f58-969d-25eda7cb3aac}</destination>
2188+
</relationship>
2189+
<relationship name="automationPoints">
2190+
<destination>{ab5d79f8-7545-4460-961e-f42590cc052b}</destination>
2191+
<destination>{fd2e6968-6590-4972-9776-04d50afd4f9f}</destination>
2192+
</relationship>
2193+
</object>
21092194
<object class="AutomationCurve" id="{f35a1ec8-0cc4-47bd-b140-da8e1d7340e7}">
21102195
<relationship name="parameter">
21112196
<destination>{9522f28d-24f9-494f-86fd-de88986568ec}</destination>
@@ -2198,13 +2283,45 @@
21982283
</property>
21992284
</object>
22002285
<object class="AutomationPoint" id="{1b886bda-60bb-4473-a7f9-2195b94b9861}">
2286+
<property name="position">
2287+
<value>0</value>
2288+
</property>
2289+
<property name="value">
2290+
<value>-3.10344887</value>
2291+
</property>
2292+
</object>
2293+
<object class="AutomationPoint" id="{5ad2b906-3ee7-428e-ba37-128cd524c5a9}">
2294+
<property name="position">
2295+
<value>0</value>
2296+
</property>
2297+
<property name="value">
2298+
<value>0</value>
2299+
</property>
2300+
</object>
2301+
<object class="AutomationPoint" id="{20767c01-21b7-4d57-b50c-d5c5f5e0b117}">
2302+
<property name="position">
2303+
<value>1</value>
2304+
</property>
2305+
<property name="value">
2306+
<value>-4</value>
2307+
</property>
2308+
</object>
2309+
<object class="AutomationPoint" id="{ab5d79f8-7545-4460-961e-f42590cc052b}">
22012310
<property name="position">
22022311
<value>0</value>
22032312
</property>
22042313
<property name="value">
22052314
<value>0</value>
22062315
</property>
22072316
</object>
2317+
<object class="AutomationPoint" id="{fd2e6968-6590-4972-9776-04d50afd4f9f}">
2318+
<property name="position">
2319+
<value>1</value>
2320+
</property>
2321+
<property name="value">
2322+
<value>-6</value>
2323+
</property>
2324+
</object>
22082325
<object class="AutomationPoint" id="{2cbfb2f0-89ef-46c5-b587-3bbfda9117dd}">
22092326
<property name="position">
22102327
<value>197.89473684210526</value>
@@ -2283,15 +2400,15 @@
22832400
<value>-80</value>
22842401
</property>
22852402
<property name="curveShape">
2286-
<value>-0.143533111</value>
2403+
<value>0.254100502</value>
22872404
</property>
22882405
</object>
22892406
<object class="AutomationPoint" id="{14b50310-562e-49ec-9df0-19fc5424cd2f}">
22902407
<property name="position">
22912408
<value>2.1052631578947367</value>
22922409
</property>
22932410
<property name="value">
2294-
<value>-13</value>
2411+
<value>-18</value>
22952412
</property>
22962413
</object>
22972414
<object class="AutomationPoint" id="{c9c6154c-9022-4990-8384-c01d1133905a}">
@@ -2309,6 +2426,9 @@
23092426
<property name="value">
23102427
<value>-80</value>
23112428
</property>
2429+
<property name="curveShape">
2430+
<value>0.0361811779</value>
2431+
</property>
23122432
</object>
23132433
<object class="AutomationPoint" id="{f7077538-3a7d-485d-95cb-c779bd4b6d24}">
23142434
<property name="position">
@@ -2323,10 +2443,10 @@
23232443
<value>431.57894736842104</value>
23242444
</property>
23252445
<property name="value">
2326-
<value>-2</value>
2446+
<value>-7</value>
23272447
</property>
23282448
<property name="curveShape">
2329-
<value>0.800552011</value>
2449+
<value>-0.0120092984</value>
23302450
</property>
23312451
</object>
23322452
<object class="AutomationPoint" id="{7b8cf5c0-625b-4442-b3bc-522007fc8d2d}">
@@ -2356,7 +2476,7 @@
23562476
<value>22000</value>
23572477
</property>
23582478
<property name="curveShape">
2359-
<value>0.761539102</value>
2479+
<value>0.506975412</value>
23602480
</property>
23612481
</object>
23622482
<object class="AutomationPoint" id="{9dab9835-cd62-4aad-91e0-7e6b0b9d8dc7}">
@@ -2374,13 +2494,16 @@
23742494
<property name="value">
23752495
<value>0.650000036</value>
23762496
</property>
2497+
<property name="curveShape">
2498+
<value>0.191711664</value>
2499+
</property>
23772500
</object>
23782501
<object class="AutomationPoint" id="{dfefa37c-1950-4214-b12f-12e5ec529290}">
23792502
<property name="position">
23802503
<value>2.1052631578947367</value>
23812504
</property>
23822505
<property name="value">
2383-
<value>5.5</value>
2506+
<value>2</value>
23842507
</property>
23852508
</object>
23862509
</objects>

‎.fmod/Metadata/Event/{7d63e971-1d9e-4ff6-82a2-16f080b91575}.xml

+11-8
Original file line numberDiff line numberDiff line change
@@ -441,23 +441,26 @@
441441
<property name="filterTypeB">
442442
<value>9</value>
443443
</property>
444+
<property name="filterTypeC">
445+
<value>3</value>
446+
</property>
444447
<property name="frequencyA">
445-
<value>438.290649</value>
448+
<value>179.820633</value>
446449
</property>
447450
<property name="frequencyB">
448-
<value>1869.11658</value>
451+
<value>3338.7666</value>
449452
</property>
450453
<property name="qualityA">
451-
<value>0.680000007</value>
454+
<value>0.439999998</value>
452455
</property>
453456
<property name="qualityB">
454457
<value>3.29999995</value>
455458
</property>
456459
<property name="gainA">
457-
<value>-16.5517235</value>
460+
<value>-15</value>
458461
</property>
459462
<property name="gainB">
460-
<value>-9.5</value>
463+
<value>-16.034481</value>
461464
</property>
462465
<relationship name="automators">
463466
<destination>{c3182651-e5ab-4b1a-a157-f4b2d1f66b13}</destination>
@@ -598,23 +601,23 @@
598601
<value>1</value>
599602
</property>
600603
<property name="value">
601-
<value>3.30000019</value>
604+
<value>0.179999948</value>
602605
</property>
603606
</object>
604607
<object class="AutomationPoint" id="{b03b1473-d683-45fe-8611-d7ebfd919f8d}">
605608
<property name="position">
606609
<value>3</value>
607610
</property>
608611
<property name="value">
609-
<value>3.30000019</value>
612+
<value>0.179999948</value>
610613
</property>
611614
</object>
612615
<object class="AutomationPoint" id="{e81e76af-51dd-43b7-ad25-bf900518ed35}">
613616
<property name="position">
614617
<value>2</value>
615618
</property>
616619
<property name="value">
617-
<value>0.650000036</value>
620+
<value>0.100000001</value>
618621
</property>
619622
</object>
620623
</objects>

‎.fmod/Metadata/Event/{88b8922b-c518-4774-8fd4-9d04c093463f}.xml

+8-2
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@
133133
<property name="length">
134134
<value>8.4949375000000007</value>
135135
</property>
136+
<property name="volume">
137+
<value>-8.5</value>
138+
</property>
136139
<property name="looping">
137140
<value>true</value>
138141
</property>
@@ -179,6 +182,9 @@
179182
<property name="length">
180183
<value>3.9262291666666669</value>
181184
</property>
185+
<property name="volume">
186+
<value>-8.5</value>
187+
</property>
182188
<property name="looping">
183189
<value>true</value>
184190
</property>
@@ -339,10 +345,10 @@
339345
</object>
340346
<object class="AutomationPoint" id="{65f0e349-fd4d-4e97-b67d-908b5cca0c5b}">
341347
<property name="position">
342-
<value>25</value>
348+
<value>24</value>
343349
</property>
344350
<property name="value">
345-
<value>-34</value>
351+
<value>-32</value>
346352
</property>
347353
</object>
348354
<object class="Automator" id="{e82bb6dd-655f-434c-a4ee-f5a5432e2bf4}">

‎.fmod/Metadata/Group/{11f05249-3142-4143-b8c7-ade7275888ca}.xml

+4-4
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@
4444
<value>gainA</value>
4545
</property>
4646
<property name="amount">
47-
<value>-24</value>
47+
<value>-4</value>
4848
</property>
4949
<property name="attackTime">
50-
<value>64</value>
50+
<value>79</value>
5151
</property>
5252
<property name="releaseTime">
53-
<value>86</value>
53+
<value>160</value>
5454
</property>
5555
<property name="minimumThreshold">
5656
<value>-80</value>
@@ -59,7 +59,7 @@
5959
<value>-39</value>
6060
</property>
6161
<relationship name="sidechains">
62-
<destination>{4b9e3ca1-186c-443e-acf7-81cff8c421ac}</destination>
62+
<destination>{953b5b43-d347-4dac-81fb-21c8d102d1a7}</destination>
6363
</relationship>
6464
</object>
6565
</objects>

‎.fmod/Metadata/Group/{8828b189-4762-4fbd-bd22-e10b3b6ce9e1}.xml

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
<relationship name="effects">
2222
<destination>{01d5ba7e-9698-42c5-b095-296963c99557}</destination>
2323
<destination>{3ca03bfd-5563-4de5-be5a-3927541b2fce}</destination>
24+
<destination>{953b5b43-d347-4dac-81fb-21c8d102d1a7}</destination>
2425
</relationship>
2526
</object>
2627
<object class="MixerBusPanner" id="{c9f77aa6-60b6-4de9-8b19-944b917de873}" />
@@ -30,4 +31,5 @@
3031
<value>10</value>
3132
</property>
3233
</object>
34+
<object class="Sidechain" id="{953b5b43-d347-4dac-81fb-21c8d102d1a7}" />
3335
</objects>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<objects serializationModel="Studio.02.02.00">
3+
<object class="ParameterPreset" id="{f648c77f-5ff1-4e7c-b608-1bc3f33333fe}">
4+
<property name="name">
5+
<value>in-dialogue</value>
6+
</property>
7+
<relationship name="folder">
8+
<destination>{007d5526-84de-483c-8aa5-66a43d869085}</destination>
9+
</relationship>
10+
<relationship name="parameter">
11+
<destination>{52ea6d0d-0697-4f58-969d-25eda7cb3aac}</destination>
12+
</relationship>
13+
</object>
14+
<object class="GameParameter" id="{52ea6d0d-0697-4f58-969d-25eda7cb3aac}">
15+
<property name="parameterType">
16+
<value>1</value>
17+
</property>
18+
<property name="maximum">
19+
<value>2</value>
20+
</property>
21+
<property name="isGlobal">
22+
<value>true</value>
23+
</property>
24+
<property name="initialValue">
25+
<value>0</value>
26+
</property>
27+
<property name="isExposedRecursively">
28+
<value>false</value>
29+
</property>
30+
</object>
31+
</objects>
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Assets/Audio/Parameters/InDialogueParameter.asset.meta

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Assets/Player/ManagerStates/DialogueState.cs

+5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
using UnityEngine.Rendering;
1414
using Utils;
1515
using View.Dialogue;
16+
using Audio.Parameters;
1617

1718
namespace Player.ManagerStates {
1819
[Serializable]
@@ -31,6 +32,7 @@ private enum SubState {
3132
[SerializeField] private FMODEventInstance _nextSound;
3233
[SerializeField] private FMODEventInstance _exitSound;
3334
[SerializeField] private FMODEventInstance _optionSound;
35+
[SerializeField] private FMODParameterInstance _inDialogueParam;
3436
[SerializeField] [Inject] private GameplaySettingsBundle _bundle;
3537

3638
[SerializeField] private Volume _volume;
@@ -55,6 +57,7 @@ protected override void Awake() {
5557
_nextSound.Setup();
5658
_exitSound.Setup();
5759
_optionSound.Setup();
60+
_inDialogueParam.Setup();
5861
}
5962

6063
protected override void OnDestroy() {
@@ -108,6 +111,7 @@ public override void OnEnter() {
108111
_dialogue.Track.Restart();
109112
_dialogue.Wheel.Restart();
110113
_lastUpdateTime = Time.time;
114+
_inDialogueParam.CurrentValue = 1;
111115
}
112116

113117
public override void OnExit() {
@@ -121,6 +125,7 @@ public override void OnExit() {
121125
_volume.weight = 0;
122126
CurrentEntry = null;
123127
_queuedEntry = null;
128+
_inDialogueParam.CurrentValue = 0;
124129
}
125130

126131
public override void OnUpdate() {

‎Assets/Player/Prefab/PlayerManager.prefab

+3-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
Please sign in to comment.