Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
snd_interface.c
Go to the documentation of this file.
1#include "common.h"
2#include "audio.h"
3#include "audio/core.h"
4
5static u8* snd_song_get_track_volumes_set(MusicTrackVols arg0);
6
11
14
15// lists of data:
16// u8 trackIdx
17// u8 volume
18// repeated until idx = 0
20 2, 94,
21 3, 80,
22 4, 100,
23 5, 84,
24 0
25};
27 2, 100,
28 3, 110,
29 4, 90,
30 0
31};
33 2, 95,
34 0
35};
37 5, 70,
38 6, 90,
39 7, 90,
40 8, 100,
41 0
42};
43// used in kpa_60-63
45 5, 0,
46 6, 0,
47 7, 0,
48 8, 0,
49 9, 0,
50 10, 0,
51 11, 0,
52 12, 0,
53 13, 0,
54 14, 0,
55 15, 0,
56 16, 0,
57 0
58};
59// starting areas, only basic instrumentation
61 5, 100,
62 6, 102,
63 7, 88,
64 8, 110,
65 9, 0,
66 10, 0,
67 11, 0,
68 12, 0,
69 13, 0,
70 14, 0,
71 15, 0,
72 16, 0,
73 0
74};
75// middle areas
77 5, 100,
78 6, 102,
79 7, 88,
80 8, 110,
81 9, 126,
82 10, 88,
83 11, 100,
84 12, 0,
85 13, 0,
86 14, 0,
87 15, 0,
88 16, 0,
89 0
90};
91// final areas, full instrumentation
93 5, 100,
94 6, 102,
95 7, 88,
96 8, 110,
97 9, 126,
98 10, 88,
99 11, 100,
100 12, 100,
101 13, 106,
102 14, 100,
103 15, 100,
104 16, 110,
105 0
106};
107
112
115// but only BGM and SFX are supported.
118 u32 type = id & 0xF;
119
120 if (ready == 1) {
121 switch (type) {
122 case 2:
123 case 3:
124 break;
125 case 4:
126 snd_start_sound_with_shift(id >> 4, 0, 0, 0);
127 break;
128 case 1:
129 if (type == 1) {
130 s32 filename = snd_song_load((id >> 4) & 0xFF, 0);
131
132 if (filename > ASCII_TO_U32('0', ' ', ' ', '\0')) {
133 snd_song_request_play(filename, (id >> 0xC) & 3);
134 }
135 }
136 break;
137 }
138 }
139}
140
144 s32 i;
145
146 for (i = 0; i < ARRAY_COUNT(player->cmdBufData); i++) {
147 player->cmdBufData[i] = 0;
148 }
149
150 player->cmdBufOverflows = 0;
151 player->cmdBufWritePos = 0;
152 player->cmdBufReadPos = 0;
153 player->cmdBufPending = 0;
154}
155
160 BGMPlayer* player = NULL;
161 u32 playerID = cmd & 0xF;
162
163 if (playerID == 0) {
164 return;
165 } else if (playerID == 1) {
166 player = gBGMPlayerA;
167 } else if (playerID == 2) {
168 player = gBGMPlayerB;
169 }
170
171 if (player != NULL) {
172 u32 pos;
173
174 if (player->cmdBufPending < ARRAY_COUNT(player->cmdBufData)) {
175 pos = player->cmdBufWritePos;
176
177 player->cmdBufData[pos] = cmd >> 4;
178
179 pos++;
180 if (pos >= 8) {
181 pos = 0;
182 }
183 player->cmdBufWritePos = pos;
184
185 player->cmdBufPending++;
186 } else {
187 pos = player->cmdBufOverflows + 1;
188
189 if (pos > 99) {
190 pos = 99;
191 }
192 player->cmdBufOverflows = pos;
193 }
194 }
195}
196
197void snd_start_sound(s32 soundID, u8 volume, u8 pan) {
198 SoundManager* soundManager = gSoundManager;
199 s16 vol = volume << 8;
200
201 if (vol != 0) {
202 vol |= 0xFF;
203 }
204
205 if (pan > AU_PAN_MAX) {
206 pan = AU_PAN_MAX;
207 }
208
209 au_sfx_enqueue_event(soundManager, soundID, vol, 0, pan);
210}
211
212void snd_start_sound_with_shift(s32 soundID, u8 volume, u8 pan, s16 pitchShift) {
213 SoundManager* soundManager = gSoundManager;
214 s16 vol = volume << 8;
215
216 if (vol != 0) {
217 vol |= 0xFF;
218 }
219
220 if (pan > AU_PAN_MAX) {
221 pan = AU_PAN_MAX;
222 }
223
224 if (pitchShift > 2 * AU_OCTAVE_CENTS) {
225 pitchShift = 2 * AU_OCTAVE_CENTS;
226 } else if (pitchShift < -2 * AU_OCTAVE_CENTS) {
227 pitchShift = -2 * AU_OCTAVE_CENTS;
228 }
229
230 au_sfx_enqueue_event(soundManager, soundID, vol, pitchShift, pan);
231}
232
233void snd_adjust_sound(s32 soundID, u8 volume, u8 pan) {
234 SoundManager* soundManager = gSoundManager;
235 s16 vol = volume << 8;
236
237 if (vol != 0) {
238 vol |= 0xFF;
239 }
240
241 if (pan > AU_PAN_MAX) {
242 pan = AU_PAN_MAX;
243 }
244
245 au_sfx_enqueue_event(soundManager, soundID | SOUND_ID_ADJUST, vol, 0, pan);
246}
247
248void snd_adjust_sound_with_shift(s32 soundID, u8 volume, u8 pan, s16 pitchShift) {
249 SoundManager* soundManager = gSoundManager;
250 s16 vol = volume << 8;
251
252 if (vol != 0) {
253 vol |= 0xFF;
254 }
255
256 if (pan > AU_PAN_MAX) {
257 pan = AU_PAN_MAX;
258 }
259
260 if (pitchShift > 2 * AU_OCTAVE_CENTS) {
261 pitchShift = 2 * AU_OCTAVE_CENTS;
262 } else if (pitchShift < -2 * AU_OCTAVE_CENTS) {
263 pitchShift = -2 * AU_OCTAVE_CENTS;
264 }
265
266 au_sfx_enqueue_event(soundManager, soundID | SOUND_ID_ADJUST, vol, pitchShift, pan);
267}
268
269void snd_stop_sound(s32 soundID) {
270 SoundManager* soundManager = gSoundManager;
271
272 au_sfx_enqueue_event(soundManager, soundID | SOUND_ID_STOP, 0, 0, 0);
273}
274
275void snd_reset(void) {
277}
278
279void snd_start_sound_raw(s32 soundID, s16 volume, s16 pitchShift, s32 pan) {
280 SoundManager* soundManager = gSoundManager;
281
282 au_sfx_enqueue_event(soundManager, soundID, volume, pitchShift, pan);
283}
284
288
289AuResult snd_ambient_play(s32 index, s32 fadeInTime) {
290 AuResult status = au_mseq_check_player_index(index);
291
292 if (status != AU_RESULT_OK) {
293 return status;
294 }
295 return au_mseq_start(index, fadeInTime);
296}
297
299 AuResult status = au_mseq_check_player_index(index);
300
301 if (status == AU_RESULT_OK) {
302 au_mseq_stop_quick(index);
303 }
304
305 return status;
306}
307
309 AuResult status = au_mseq_check_player_index(index);
310
311 if (status == AU_RESULT_OK) {
312 au_mseq_stop_slow(index, fadeOutTime);
313 }
314
315 return status;
316}
317
318AuResult snd_ambient_pause(s32 index, s32 fadeOutTime) {
319 AuResult status = au_mseq_check_player_index(index);
320
321 if (status == AU_RESULT_OK) {
322 au_mseq_pause(index, fadeOutTime);
323 }
324
325 return status;
326}
327
328AuResult snd_ambient_resume(s32 index, s32 fadeInTime) {
329 AuResult status = au_mseq_check_player_index(index);
330
331 if (status == AU_RESULT_OK) {
332 au_mseq_resume(index, fadeInTime);
333 }
334
335 return status;
336}
337
339 AuResult status = au_mseq_check_player_index(index);
340
341 if (status != AU_RESULT_OK) {
342 return status;
343 }
344 return au_mseq_check_stopped(index);
345}
346
348 AuResult status = au_mseq_check_player_index(index);
349
350 if (status == AU_RESULT_OK) {
351 au_mseq_load_tracks_fade(index, arg1);
352 }
353
354 return status;
355}
356
358 AuResult status = au_mseq_check_player_index(index);
359
360 if (status == AU_RESULT_OK) {
361 au_mseq_set_volume(index, time, volume);
362 }
363
364 return status;
365}
366
368 AuResult status = au_mseq_check_player_index(index);
369
370 if (status == AU_RESULT_OK) {
372 }
373
374 return status;
375}
376
378 AuResult status = au_mseq_check_player_index(index);
379
380 if (status == AU_RESULT_OK) {
382 }
383
384 return status;
385}
386
388 s32 radioChannels = 4;
389 u32 i;
390
392
393 for (i = 0; i < radioChannels; i++) {
394 if (snd_ambient_play(i, 0) != AU_RESULT_OK) {
395 return;
396 }
397 }
398
400}
401
403 AuResult status = AU_RESULT_OK;
404 s32 radioChannels = 4;
405 u32 i;
406
407 for (i = 0; i < radioChannels; i++) {
408 if (i == AmbienceRadioChannel) {
409 status = snd_ambient_stop_slow(i, time);
410 } else {
411 status = snd_ambient_stop_quick(i);
412 }
413 if (status != AU_RESULT_OK) {
414 break;
415 }
416 }
417 return status;
418}
419
421 AuResult status = AU_RESULT_OK;
422 s32 radioChannels = 4;
423
424 if (index != AmbienceRadioChannel) {
425 u32 i;
426
427 for (i = 0; i < radioChannels; i++) {
428 if (i == index) {
429 status = snd_ambient_enable(i);
430 } else {
431 status = snd_ambient_disable(i); // mute
432 }
433
434 if (status != AU_RESULT_OK) {
435 break;
436 }
437 }
438
439 if (status == AU_RESULT_OK) {
440 AmbienceRadioChannel = index;
441 }
442 }
443
444 return status;
445}
446
447AuResult snd_song_load(s32 songID, s32 playerIndex) {
448 BGMHeader* bgmFile;
449 BGMPlayer* player;
450
451 au_get_bgm_player_and_file(playerIndex, &bgmFile, &player);
452
453 if (bgmFile != NULL) {
454 return au_load_song_files(songID, bgmFile, player);
455 } else {
457 }
458}
459
462 AuResult status;
464
466 s.songName = songName;
467 s.duration = 0;
471 s.unused_14 = 0;
472 status = au_bgm_process_init_song(&s);
474
475 return status;
476}
477
479AuResult snd_song_request_play(s32 songName, s32 variation) {
480 AuResult status;
482
484 s.songName = songName;
485 s.duration = 0;
488 s.variation = variation;
489 s.unused_14 = 0;
490 status = au_bgm_process_init_song(&s);
492
493 return status;
494}
495
497 return au_bgm_stop_song(songName);
498}
499
502}
503
505 return au_bgm_is_song_playing(songName);
506}
507
509AuResult snd_song_request_fade_in(s32 songName, s32 variation, s32 fadeInTime, s32 startVolume, s32 endVolume) {
510 AuResult status;
512
514 s.songName = songName;
515 s.duration = fadeInTime;
516 s.startVolume = startVolume;
518 s.variation = variation;
519 s.unused_14 = 0;
520 status = au_bgm_process_init_song(&s);
522
523 return status;
524}
525
527AuResult snd_song_request_fade_in_default(s32 songName, s32 fadeInTime, s32 startVolume, s32 endVolume) {
528 AuResult status;
530
532 s.songName = songName;
533 s.duration = fadeInTime;
534 s.startVolume = startVolume;
536 s.variation = 0;
537 s.unused_14 = 0;
538 status = au_bgm_process_init_song(&s);
540
541 return status;
542}
543
544AuResult snd_song_request_fade_out(s32 songName, s32 fadeTime, AuCallback callback) {
546
547 s.songName = songName;
548 s.duration = fadeTime;
549 s.unused_08 = 0;
550 s.finalVolume = 0;
551 s.doneCallback = callback;
552 s.onPush = FALSE;
553
554 return au_bgm_process_fade_out(&s);
555}
556
559
560 s.songName = songName;
561 s.duration = 0;
562 s.startVolume = 0;
563 s.finalVolume = 0;
565 s.pauseMode = FALSE;
566
567 return au_bgm_process_suspend(&s, FALSE); // force stop
568}
569
571 AuResult status;
573
575 s.songName = songName;
576 s.duration = 2000;
577 s.startVolume = 1;
580 s.pauseMode = FALSE;
581 status = au_bgm_process_resume(&s);
583
584 return status;
585}
586
589
590 s.songName = songName;
591 s.duration = 0;
592 s.startVolume = 0;
593 s.finalVolume = 0;
595 s.pauseMode = FALSE;
596
597 return au_bgm_process_suspend(&s, TRUE); // no stop
598}
599
602
603 s.songName = songName;
604 s.duration = fadeTime;
605 s.unused_08 = 0;
606 s.finalVolume = 0;
607 s.doneCallback = NULL;
608 s.onPush = TRUE;
609
610 return au_bgm_process_fade_out(&s);
611}
612
615
616 s.songName = songName;
617 s.duration = 0;
618 s.startVolume = 0;
619 s.finalVolume = 0;
621 s.pauseMode = TRUE;
622
623 return au_bgm_process_suspend(&s, FALSE); // force stop
624}
625
628
629 s.songName = songName;
630 s.duration = 0;
631 s.startVolume = 0;
632 s.finalVolume = 0;
634 s.pauseMode = TRUE;
635
636 return au_bgm_process_resume(&s);
637}
638
641
642 s.songName = songName;
643 s.duration = 500;
644 s.finalVolume = 0.25001 * AU_MAX_VOLUME_16;
645
646 return au_bgm_adjust_volume(&s);
647}
648
651
652 s.songName = songName;
653 s.duration = 500;
655
656 return au_bgm_adjust_volume(&s);
657}
658
661
662 s.songName = songName;
663 s.enabled = mode;
664
665 return au_bgm_set_linked_tracks(&s);
666}
667
668// get file and player information for a given song name if it's currently playing
670 AuResult status = AU_RESULT_OK;
671 BGMHeader* bgmFile;
672
673 bgmFile = gSoundGlobals->dataBGM[0];
674 if (songName == bgmFile->name) {
676 *outFile = bgmFile;
677 } else {
678 bgmFile = gSoundGlobals->dataBGM[1];
679 if (songName == bgmFile->name) {
681 *outFile = bgmFile;
682 } else {
683 status = AU_ERROR_1;
684 }
685 }
686 return status;
687}
688
690 BGMPlayer* bgmPlayer;
691 BGMHeader* bgmFile;
692 AuResult status;
693
694 status = snd_song_get_playing_info(songName, &bgmFile, &bgmPlayer);
695
696 if (status == AU_RESULT_OK) {
697 au_bgm_set_playback_rate(bgmPlayer, rate);
698 }
699
700 return status;
701}
702
704 BGMPlayer* bgmPlayer;
705 BGMHeader* bgmFile;
706 AuResult status;
707
708 status = snd_song_get_playing_info(songName, &bgmFile, &bgmPlayer);
709
710 if (status == AU_RESULT_OK) {
711 au_bgm_player_set_detune(bgmPlayer, detune);
712 }
713
714 return status;
715}
716
718 BGMPlayer* bgmPlayer;
719 BGMHeader* bgmFile;
720 AuResult status;
721
722 status = snd_song_get_playing_info(songName, &bgmFile, &bgmPlayer);
723
724 if (status == AU_RESULT_OK) {
725 u8* trackVols = snd_song_get_track_volumes_set(trackVolSet);
726
727 if (trackVols != NULL) {
729 } else {
730 status = AU_ERROR_11;
731 }
732 }
733
734 return status;
735}
736
738 BGMPlayer* bgmPlayer;
739 BGMHeader* bgmFile;
740 AuResult status;
741
742 status = snd_song_get_playing_info(songName, &bgmFile, &bgmPlayer);
743
744 if (status == AU_RESULT_OK) {
745 u8* trackVols = snd_song_get_track_volumes_set(trackVolSet);
746
747 if (trackVols != NULL) {
749 } else {
750 status = AU_ERROR_11;
751 }
752 }
753
754 return status;
755}
756
757static u8* snd_song_get_track_volumes_set(MusicTrackVols trackVolSet) {
758 u8* trackVols = NULL;
759
760 switch (trackVolSet) {
763 break;
766 break;
769 break;
772 break;
775 break;
776 case TRACK_VOLS_KPA_1:
778 break;
779 case TRACK_VOLS_KPA_2:
781 break;
782 case TRACK_VOLS_KPA_3:
784 break;
785 }
786
787 return trackVols;
788}
789
790static AuResult snd_song_change_track_volume(s32 songName, u32 trackIdx, u32 volume) {
791 BGMPlayer* bgmPlayer;
792 BGMHeader* bgmFile;
793 AuResult status;
794
795 status = snd_song_get_playing_info(songName, &bgmFile, &bgmPlayer);
796 if (status == AU_RESULT_OK) {
797 if (volume > AU_MAX_VOLUME_8) {
798 volume = AU_MAX_VOLUME_8;
799 }
800 if (trackIdx > 15) {
801 trackIdx = 15;
802 }
803 au_bgm_change_track_volume(bgmPlayer, trackIdx, 96, volume);
804 }
805 return status;
806}
807
809 return snd_song_change_track_volume(songName, trackIdx, 0);
810}
811
813 return snd_song_change_track_volume(songName, trackIdx, AU_MAX_VOLUME_8 / 2);
814}
815
817 return snd_song_change_track_volume(songName, trackIdx, AU_MAX_VOLUME_8);
818}
819
823
825 au_bgm_set_proximity_mix(songName, (u8)mix | ((s32)(0.69f * AU_MAX_VOLUME_8) << 24));
826}
827
831
833 AuGlobals* globals = gSoundGlobals;
834
835 *musicEvents = globals->musicEventQueue;
836 *count = globals->musicEventQueueCount;
837}
838
842
843void snd_song_trigger_music_event(s32 playerID, s32 trackIndex, s32 eventInfo) {
844 AuGlobals* globals = gSoundGlobals;
845
846 if (globals->musicEventQueueCount < MUS_QUEUE_SIZE) {
847 *globals->musicEventQueuePos++ = ((playerID << 28) + ((trackIndex & 0xF) << 24) + eventInfo);
848 globals->musicEventQueueCount++;
849 }
850}
851
853 AuGlobals* globals = gSoundGlobals;
854 s32* buf = globals->musicEventQueue;
855 s32 i = 15;
856
857 do {
858 *buf++ = 0;
859 } while (i-- != 0);
860
861 globals->musicEventQueueCount = 0;
862 globals->flushMusicEventQueue = FALSE;
863 globals->musicEventQueuePos = globals->musicEventQueue;
864}
865
866static const f32 padding[] = {0.0f};
867
869 gSoundGlobals->audioThreadCallbacks[index] = func;
870}
871
876
881
885
889
893
897
BSS s32 PopupMenu_SelectedIndex
@ SND_MANAGER_STATE_DISABLED
Definition audio.h:365
@ SND_MANAGER_STATE_ENABLED
Definition audio.h:364
u8 cmdBufPending
Buffer for an unused (legacy) system for controlling the BGMPlayer from the main thread.
Definition audio.h:1213
BGMPlayer * gBGMPlayerB
Definition engine.c:7
#define MUS_QUEUE_SIZE
Definition audio.h:107
AuCallback doneCallback
Definition audio.h:1239
MusicEventTrigger * musicEventQueue
Definition audio.h:1058
SoundManager * gSoundManager
Definition engine.c:9
AuGlobals * gSoundGlobals
Definition engine.c:10
s32 flushMusicEventQueue
Definition audio.h:1060
AuCallback audioThreadCallbacks[2]
Definition audio.h:1062
@ AUDIO_TYPE_BGM
Definition audio.h:398
@ AUDIO_TYPE_SFX
Definition audio.h:399
#define AU_MAX_VOLUME_8
Definition audio.h:61
s32 name
Definition audio.h:882
BGMPlayer * gBGMPlayerA
Definition engine.c:6
s32 cmdBufData[8]
Definition audio.h:1212
@ BGM_SNAPSHOT_0
Definition audio.h:192
u8 cmdBufWritePos
Definition audio.h:1215
struct BGMHeader * dataBGM[2]
Definition audio.h:1047
#define AU_PAN_MAX
Definition audio.h:67
u8 cmdBufReadPos
Definition audio.h:1214
#define AU_OCTAVE_CENTS
Definition audio.h:114
u8 cmdBufOverflows
Definition audio.h:1216
s32 resetPending
Definition audio.h:816
#define AU_MAX_VOLUME_16
Definition audio.h:62
u32 musicEventQueueCount
Definition audio.h:1059
MusicEventTrigger * musicEventQueuePos
Definition audio.h:1057
void au_bgm_set_proximity_mix(s32 songName, u32 mix)
AuResult au_bgm_set_linked_tracks(SongSwapLinkedRequest *request)
AuResult au_bgm_is_song_playing(s32 songName)
Definition bgm_player.c:261
AuResult au_bgm_process_suspend(SongSuspendRequest *request, b32 skipStop)
Definition bgm_player.c:337
void au_bgm_change_track_volume(BGMPlayer *player, s32 trackIdx, s16 time, u8 volume)
void au_bgm_set_track_volumes(BGMPlayer *player, u8 *trackVols, s32 mode)
AuResult au_bgm_process_fade_out(SongFadeOutRequest *request)
Definition bgm_player.c:287
AuResult au_bgm_process_resume(SongResumeRequest *request)
Definition bgm_player.c:395
AuResult au_bgm_stop_song(s32 songName)
Definition bgm_player.c:227
void au_bgm_stop_all(void)
Definition bgm_player.c:247
void au_bgm_set_playback_rate(BGMPlayer *player, f32 rate)
AuResult au_bgm_adjust_volume(SongStartRequest *request)
Definition bgm_player.c:505
void au_bgm_player_set_detune(BGMPlayer *player, s32 detune)
AuResult au_bgm_process_init_song(SongStartRequest *request)
Definition bgm_player.c:135
u32 MusicEventTrigger
s32 b32
void(* AuCallback)(void)
void au_sync_channel_delay_enabled(u32 arg0)
Definition engine.c:1192
void au_set_bus_volume_level(s32 arg0, u32 idx)
Definition engine.c:1169
void au_set_stereo_enabled(b8 enabled)
Definition syn_driver.c:284
AuResult au_load_song_files(u32 arg0, BGMHeader *arg1, BGMPlayer *arg2)
Definition engine.c:558
AuResult au_ambient_load(u32 arg0)
Definition engine.c:665
void au_get_bgm_player_and_file(u32 playerIndex, BGMHeader **outCurrentTrackData, BGMPlayer **outPlayer)
Definition engine.c:518
s32 au_set_reverb_type(s32 arg0, s32 arg1)
Definition engine.c:1185
Vec3s pos
Definition demo_api.c:17
VolumeLevels
Perceptual volume levels, 0 (mute) to 8 (max).
Definition enums.h:1813
@ BGM_VARIATION_0
Definition enums.h:1805
@ SOUND_ID_ADJUST
Definition enums.h:529
@ SOUND_ID_STOP
Definition enums.h:526
MusicTrackVols
Definition enums.h:1793
@ TRACK_VOLS_TIK_SHIVER
Definition enums.h:1796
@ TRACK_VOLS_KPA_3
Definition enums.h:1801
@ TRACK_VOLS_UNUSED_3
Definition enums.h:1797
@ TRACK_VOLS_UNUSED_1
Definition enums.h:1795
@ TRACK_VOLS_KPA_OUTSIDE
Definition enums.h:1798
@ TRACK_VOLS_KPA_1
Definition enums.h:1799
@ TRACK_VOLS_KPA_2
Definition enums.h:1800
@ TRACK_VOLS_JAN_FULL
Definition enums.h:1794
AuResult
Definition enums.h:1758
@ AU_ERROR_NULL_SONG_NAME
Definition enums.h:1766
@ AU_ERROR_11
Definition enums.h:1771
@ AU_ERROR_1
Definition enums.h:1760
@ AU_RESULT_OK
Definition enums.h:1759
AuResult au_mseq_start(s32 index, s32 time)
Definition mseq_player.c:88
void au_mseq_set_disabled(s32 index, s32 disable)
Definition mseq_player.c:77
void au_mseq_stop_slow(s32 index, s32 time)
AuResult au_mseq_check_player_index(u32 index)
Definition mseq_player.c:65
void au_mseq_load_tracks_fade(s32 arg0, s32 arg1)
Definition mseq_player.c:73
void au_mseq_stop_quick(s32 index)
void au_mseq_resume(s32 index, s32 time)
AuResult au_mseq_check_stopped(s32 index)
void au_mseq_set_volume(s32 index, s32 time, s32 volume)
void au_mseq_pause(s32 index, s32 time)
void au_sfx_enqueue_event(SoundManager *manager, u32 soundID, s16 volume, s16 pitchShift, u8 pan)
Definition sfx_player.c:590
void au_sfx_set_state(SoundManager *manager, s32 arg1)
Definition sfx_player.c:739
#define ASCII_TO_U32(a, b, c, d)
Definition macros.h:191
#define ARRAY_COUNT(arr)
Definition macros.h:40
AuResult snd_ambient_disable(s32 index)
void snd_stop_sound(s32 soundID)
u8 TrackVols_KPA_3[]
u8 TrackVols_KPA_2[]
u8 TrackVols_KPA_Outside[]
void snd_start_sound_with_shift(s32 soundID, u8 volume, u8 pan, s16 pitchShift)
AuResult snd_song_push_stop(s32 songName)
void snd_disable_sfx(void)
AuResult snd_song_request_fade_out(s32 songName, s32 fadeTime, AuCallback callback)
u8 TrackVols_TIK_Shiver[]
AuResult snd_load_ambient(s32 ambSoundID)
AuResult snd_song_set_track_vol_mute(s32 songName, s32 trackIdx)
AuResult snd_song_set_track_vol_quiet(s32 songName, s32 trackIdx)
void snd_song_poll_music_events(MusicEventTrigger **musicEvents, s32 *count)
AuResult snd_ambient_stop_slow(s32 index, s32 fadeOutTime)
AuResult snd_song_request_fade_in_default(s32 songName, s32 fadeInTime, s32 startVolume, s32 endVolume)
Unused.
u16 AmbienceRadioChannel
void snd_bgm_enqueue_legacy_command(u32 cmd)
Unused Part of an unused system for inter-thread communication with a BGM player using commands.
AuResult snd_song_set_track_volumes(s32 songName, MusicTrackVols trackVolSet)
void snd_reset(void)
void snd_start_sound(s32 soundID, u8 volume, u8 pan)
AuResult snd_ambient_radio_stop(s32 time)
void snd_start_sound_raw(s32 soundID, s16 volume, s16 pitchShift, s32 pan)
AuResult snd_song_request_play(s32 songName, s32 variation)
Called from bgm_control to start playing a particular song + variation.
AuResult snd_song_request_push_fade_out(s32 songName, s32 fadeTime)
u8 TrackVols_JAN_Full[]
void snd_set_bgm_volume(VolumeLevels volume)
AuResult snd_song_set_volume_full(s32 songName)
AuResult snd_song_load(s32 songID, s32 playerIndex)
return value may be either an AuResult error code OR a valid songName
void snd_enable_sfx(void)
AuResult snd_song_request_unpause(s32 songName)
AuResult snd_song_request_pop(s32 songName)
AuResult snd_song_set_detune(s32 songName, s32 detune)
AuResult snd_ambient_set_volume(s32 index, s32 time, s32 volume)
AuResult snd_song_set_playback_rate(s32 songName, f32 rate)
void snd_adjust_sound_with_shift(s32 soundID, u8 volume, u8 pan, s16 pitchShift)
void snd_notify_engine_ready(ALHeap *heap)
void snd_register_callback(AuCallback func, s32 index)
AuResult snd_song_request_fade_in(s32 songName, s32 variation, s32 fadeInTime, s32 startVolume, s32 endVolume)
Called from bgm_control to fade in a particular song + variation.
void snd_set_sfx_reverb_type(s32 reverbType)
AuResult snd_ambient_enable(s32 index)
AuResult snd_song_set_track_vol_full(s32 songName, s32 trackIdx)
AuResult snd_ambient_resume(s32 index, s32 fadeInTime)
u8 TrackVols_Unused3[]
void snd_set_mono(void)
void snd_song_stop_all(void)
void snd_set_stereo(void)
void snd_bgm_clear_legacy_commands(BGMPlayer *player)
Part of an unused system for inter-thread communication with a BGM player using commands.
AuResult snd_song_request_snapshot(s32 songName)
AuResult snd_song_clear_track_volumes(s32 songName, MusicTrackVols trackVolSet)
u8 TrackVols_KPA_1[]
s32 PreventBGMPlayerUpdate
While TRUE, the audio thread skips BGM player updates.
AuResult snd_ambient_stop_quick(s32 index)
AuResult snd_ambient_pause(s32 index, s32 fadeOutTime)
AuResult snd_song_set_volume_quiet(s32 songName)
void snd_legacy_sound_dispatch(u32 id)
Unused Seems to be an early function that accepts a command to play any kind of audio asset,...
AuResult snd_song_request_pause(s32 songName)
void snd_adjust_sound(s32 soundID, u8 volume, u8 pan)
AuResult snd_song_is_playing(s32 songName)
u8 TrackVols_Unused1[]
void snd_song_set_proximity_mix_far(s32 songName, s32 mix)
AuResult snd_song_request_play_default(s32 songName)
Unused – snd_song_request_play but always uses BGM_VARIATION_0.
void snd_song_set_proximity_mix_near(s32 songName, s32 mix)
AuResult snd_ambient_play(s32 index, s32 fadeInTime)
void snd_ambient_radio_setup(s32 index)
AuResult snd_ambient_radio_select(s32 index)
void snd_song_set_proximity_mix_full(s32 songName, s32 mix)
AuResult snd_song_get_playing_info(s32 songName, BGMHeader **outFile, BGMPlayer **outPlayer)
void snd_set_sfx_volume(VolumeLevels volume)
void snd_song_trigger_music_event(s32 playerID, s32 trackIndex, s32 eventInfo)
void snd_song_clear_music_events(void)
AuResult snd_ambient_is_stopped(s32 index)
AuResult snd_ambient_fade_out(s32 index, s32 arg1)
u16 SoundEngineReady
AuResult snd_song_stop(s32 songName)
AuResult snd_song_set_linked_mode(s32 songName, b32 mode)
void snd_song_flush_music_events(void)