Skip to content
LeviMC
English
AutoLightDark
LeviLamina
Loading...
Searching...
No Matches
SoundSystemFMOD.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/audio/SoundPauseSource.h"
7#include "mc/deps/audio/SoundSystemBase.h"
8#include "mc/deps/audio/fmod/FileSystemFMOD.h"
9#include "mc/deps/audio/fmod/SoundInstanceListFMOD.h"
10#include "mc/deps/audio/fmod/SoundLoaderFMOD.h"
11#include "mc/deps/core/file/PathBuffer.h"
12#include "mc/deps/core/sound/SoundFormat.h"
13#include "mc/deps/core/utility/Owner.h"
14#include "mc/deps/core/utility/UniqueOwnerPointer.h"
15#include "mc/deps/game_refs/WeakRef.h"
16
17// auto generated forward declare list
18// clang-format off
21class ResourceLoader;
23class SoundCacheFMOD;
25class SoundEvent;
26class SoundItem;
29struct PlayMusicOptions;
30struct PlaySoundOptions;
33struct SoundLoadTask;
34struct SoundSystemGUID;
35namespace Audio { class IAudioAssetProvider; }
36namespace Audio { class IStreamableAudioAsset; }
37namespace Audio { class OnlineAudioStream; }
38namespace Audio { class SoundStartOptions; }
39namespace Core { class Path; }
40namespace Core { class PathView; }
41namespace FMOD { class Channel; }
42namespace FMOD { class ChannelGroup; }
43namespace FMOD { class Sound; }
44namespace FMOD { class System; }
45// clang-format on
46
48public:
49 // SoundSystemFMOD inner types declare
50 // clang-format off
51 struct StreamInfo;
52 // clang-format on
53
54 // SoundSystemFMOD inner types define
55 struct StreamInfo {
56 public:
57 // member variables
58 // NOLINTBEGIN
59 ::ll::TypedStorage<8, 8, ::FMOD::Channel*> mChannel;
60 ::ll::TypedStorage<8, 8, ::FMOD::Sound*> mSound;
61 ::ll::TypedStorage<8, 8, uint64> mHandle;
62 ::ll::TypedStorage<4, 4, int> mByteDepth;
63 ::ll::TypedStorage<4, 4, int> mChannels;
64 ::ll::TypedStorage<4, 4, int> mSamplingRate;
65 ::ll::TypedStorage<4, 4, int> mDecodeBufferSize;
66 ::ll::TypedStorage<8, 24, ::std::vector<float>> mSwapBuffer;
67 ::ll::TypedStorage<8, 80, ::std::mutex> mDataLock;
68 ::ll::TypedStorage<4, 4, uint> mWriteCursor;
69 ::ll::TypedStorage<4, 4, uint> mReadCursor;
70 ::ll::TypedStorage<8, 24, ::std::vector<float>> mData;
71 ::ll::TypedStorage<1, 1, bool> mHasReceivedAllData;
72 ::ll::TypedStorage<4, 4, float> mVolumeOnPause;
73 // NOLINTEND
74 };
75
76 using LockType = ::std::mutex;
77
78public:
79 // member variables
80 // NOLINTBEGIN
81 ::ll::TypedStorage<8, 8, ::FMOD::System*> mSystem;
82 ::ll::TypedStorage<8, 32, ::Bedrock::Owner<uint64>> mSoundUniqueID;
83 ::ll::TypedStorage<8, 40, ::SoundInstanceListFMOD> mActiveSounds;
84 ::ll::TypedStorage<8, 64, ::std::unordered_map<uint64, ::std::unique_ptr<::SoundSystemFMOD::StreamInfo>>>
85 mStreamingSounds;
86 ::ll::TypedStorage<8, 8, uint64> mLoopingSoundUniqueID;
87 ::ll::TypedStorage<8, 8, uint64> mStreamingSoundUniqueID;
88 ::ll::TypedStorage<1, 1, bool> mEnabled;
89 ::ll::TypedStorage<8, 8, ::FMOD::ChannelGroup*> mPrimaryChannelGroup;
90 ::ll::TypedStorage<8, 8, ::FMOD::ChannelGroup*> mSoundChannelGroup;
91 ::ll::TypedStorage<8, 8, ::FMOD::ChannelGroup*> mMusicChannelGroup;
92 ::ll::TypedStorage<8, 8, ::FMOD::ChannelGroup*> mTTSChannelGroup;
93 ::ll::TypedStorage<8, 16, ::std::map<::std::string, ::FMOD::ChannelGroup*>> mSoundCategoryChannelGroups;
94 ::ll::TypedStorage<1, 1, ::FileSystemFMOD> mFileSystem;
95 ::ll::TypedStorage<8, 16, ::gsl::not_null<::std::shared_ptr<::FMODSoundReleaseQueue>> const> mSoundReleaseQueue;
96 ::ll::TypedStorage<8, 8, ::gsl::not_null<::std::unique_ptr<::SoundCacheFMOD>> const> mSoundCache;
97 ::ll::TypedStorage<8, 8, ::ResourceLoader&> mResourceLoader;
98 ::ll::TypedStorage<8, 16, ::gsl::not_null<::Bedrock::UniqueOwnerPointer<::Audio::IAudioAssetProvider const>> const>
99 mAudioAssetProvider;
100 ::ll::TypedStorage<8, 144, ::SoundLoaderFMOD> mSoundLoader;
101 ::ll::TypedStorage<8, 32, ::Core::PathBuffer<::std::string>> mDataUrl;
102 ::ll::TypedStorage<8, 8, uint64> mThreadMask;
103 ::ll::TypedStorage<8, 64, ::std::function<void(::SoundLoadTask)>> mAsyncLoad;
104 ::ll::TypedStorage<4, 4, float> mEvictionStatTimer;
105 ::ll::TypedStorage<8, 8, uint64> mCurrentEvictionRate;
106 // NOLINTEND
107
108public:
109 // prevent constructor by default
110 SoundSystemFMOD& operator=(SoundSystemFMOD const&);
111 SoundSystemFMOD(SoundSystemFMOD const&);
112 SoundSystemFMOD();
113
114public:
115 // virtual functions
116 // NOLINTBEGIN
117 virtual ~SoundSystemFMOD() /*override*/ = default;
118
119 virtual bool preinit() /*override*/;
120
121 virtual void init() /*override*/;
122
123 virtual void destroy() /*override*/;
124
125 virtual void setOutputDevice(::SoundSystemGUID& outputDevice) /*override*/;
126
127 virtual void setAsyncLoadFunction(::std::function<void(::SoundLoadTask)> asyncLoad) /*override*/;
128
129 virtual void enable(bool status) /*override*/;
130
131 virtual void mute(bool muted) /*override*/;
132
133 virtual bool addListener(int const handle) /*override*/;
134
135 virtual void removeListener(int const handle) /*override*/;
136
137 virtual void setMainVolume(float vol) /*override*/;
138
139 virtual void setMusicVolume(float vol) /*override*/;
140
141 virtual void setSoundVolume(float vol) /*override*/;
142
143 virtual void setSoundCategoryVolume(::std::string const& category, float vol) /*override*/;
144
145 virtual void setTTSVolume(float vol) /*override*/;
146
147 virtual bool loadRawFromMemory(
148 ::Core::Path const& soundPath,
149 char const* data,
150 uint64 dataSize,
151 int numchannels,
152 int defaultfrequency,
153 ::SoundFormat format
154 ) /*override*/;
155
156 virtual bool loadFromMemory(::Core::Path const& soundPath, char const* data, uint64 dataSize) /*override*/;
157
158 virtual void unload(::Core::Path const& soundPath) /*override*/;
159
160 virtual void unloadAllExcept(::std::vector<::Core::PathBuffer<::std::string>> const& exceptions) /*override*/;
161
162 virtual void stop(::std::string const& eventName) /*override*/;
163
164 virtual void stop(uint64 handle) /*override*/;
165
166 virtual void stop(::ServerSoundHandle serverSoundHandle) /*override*/;
167
168 virtual void setVolume(::ServerSoundHandle serverSoundHandle, float volume) /*override*/;
169
170 virtual void setPitch(::ServerSoundHandle serverSoundHandle, float pitch) /*override*/;
171
172 virtual void fade(::ServerSoundHandle serverSoundHandle, float duration, float targetVolume) /*override*/;
173
174 virtual void setPlaybackPosition(::ServerSoundHandle serverSoundHandle, float seconds) /*override*/;
175
176 virtual void setPlaybackPosition(uint64 soundHandle, float seconds) /*override*/;
177
178 virtual void pause(::ServerSoundHandle serverSoundHandle, ::SoundPauseSource source) /*override*/;
179
180 virtual void pause(uint64 soundHandle, ::SoundPauseSource source) /*override*/;
181
182 virtual void resume(::ServerSoundHandle serverSoundHandle, ::SoundPauseSource source) /*override*/;
183
184 virtual void resume(uint64 soundHandle, ::SoundPauseSource source) /*override*/;
185
186 virtual void signalStart(uint64 soundHandle) /*override*/;
187
188 virtual void stopAllSounds() /*override*/;
189
190 virtual void pauseAllPlayingSounds(::SoundPauseSource source) /*override*/;
191
192 virtual void resumeAllPreviouslyPlayingSounds(::SoundPauseSource source) /*override*/;
193
194 virtual void fadeOut(uint64 handle, float duration) const /*override*/;
195
196 virtual uint64
197 playEvent(::SoundEvent const& soundEvent, ::std::string const& eventName, float volume, float pitch) /*override*/;
198
199 virtual uint64 playEventAt(
200 ::SoundEvent const& soundEvent,
201 ::std::string const& eventName,
202 float x,
203 float y,
204 float z,
205 float volume,
206 float pitch,
207 ::std::optional<::ServerSoundHandle> serverSoundHandle
208 ) /*override*/;
209
210 virtual uint64 playEventAt(::SoundEvent const& soundEvent, ::PlaySoundOptions const& options) /*override*/;
211
212 virtual uint64 playStreamableEventAt(
213 ::SoundEvent const& soundEvent,
214 ::SoundItem const& soundItem,
215 ::std::unique_ptr<::Audio::IStreamableAudioAsset> streamableAudioAsset,
216 ::PlaySoundOptions const& options
217 ) /*override*/;
218
219 virtual uint64 playEventAttached(
220 ::SoundEvent const& soundEvent,
221 ::std::string const& eventName,
222 ::std::function<void(::SoundInstanceProperties&)>&& getSoundProperties
223 ) /*override*/;
224
225 virtual uint64 playAt(
226 ::Core::Path const& soundPath,
227 ::SoundEvent const* soundEvent,
228 ::std::string const& eventName,
229 uint64 soundHandle,
230 float x,
231 float y,
232 float z,
233 float volume,
234 float pitch,
235 bool is3D,
236 float minDistance,
237 float maxDistance,
238 bool useLegacyMaxDistance,
239 bool isTTS,
240 ::std::optional<::ServerSoundHandle> serverSoundHandle,
241 int loopCount,
242 float volumeBase
243 ) /*override*/;
244
245 virtual void playMusic(::PlayMusicOptions options, ::SoundItem const& soundItem) /*override*/;
246
247 virtual uint64 playStreamableMusic(
248 ::std::string const& eventName,
249 ::SoundItem const& soundItem,
250 ::std::unique_ptr<::Audio::IStreamableAudioAsset> streamableAudioAsset
251 ) /*override*/;
252
253 virtual void pauseMusic(bool paused) /*override*/;
254
255 virtual void stopMusic() /*override*/;
256
257 virtual void fadeMusicOut(float time) /*override*/;
258
259 virtual bool isMusicChannelPlaying() const /*override*/;
260
261 virtual bool isPlayingMusicEvent(::std::string const& eventName) const /*override*/;
262
263 virtual bool isPlayingMusic(::Core::PathView soundPath) const /*override*/;
264
265 virtual bool isLoadingMusic() const /*override*/;
266
267 virtual void cancelLoadMusic() /*override*/;
268
269 virtual ::Core::PathView getCurrentlyPlayingMusicPath() const /*override*/;
270
271 virtual ::std::string getCurrentlyPlayingEventName() const /*override*/;
272
273 virtual void update(float elapsedTime) /*override*/;
274
275 virtual void playSound(
276 float x,
277 float y,
278 float z,
279 float volume,
280 float pitch,
281 ::FMOD::ChannelGroup* channelGroup,
282 ::FMOD::Channel*& channel,
283 ::FMOD::Sound*& soundToPlay,
284 bool is3D,
285 float minDistance,
286 float maxDistance,
287 bool useLegacyMaxDistance,
288 int loopCount
289 );
290
291 virtual ::FMOD::Sound* getFirstSubSound(::std::shared_ptr<::FMOD::Sound> const& sound) const;
292
293 virtual bool isPlayingSound(uint64 handle) const /*override*/;
294
295 virtual bool isPlayingSound(::Core::Path const& soundPath) const /*override*/;
296
297 virtual bool isPlayingSound(::ServerSoundHandle serverSoundHandle) const /*override*/;
298
299 virtual bool isSoundActive(uint64 handle) const /*override*/;
300
301 virtual bool wasSoundStoppedExplicitly(::ServerSoundHandle serverSoundHandle) const /*override*/;
302
303 virtual uint64 registerLoop(
304 ::SoundItem const& soundItem,
305 ::std::weak_ptr<::SoundEvent> const soundEvent,
306 ::std::string const& eventName,
307 ::std::function<void(::LoopingSoundState&)> getSoundState,
308 float fadeInDuration,
309 float fadeOutDuration
310 ) /*override*/;
311
312 virtual void unregisterLoop(uint64 handle, bool hard) /*override*/;
313
314 virtual void displayDebugStats(::std::string& debugOutputFormat) const /*override*/;
315
316 virtual uint64 getNewSoundHandle() /*override*/;
317
318 virtual ::std::optional<::PlayingSoundAttributes> tryGetPlayingSoundAttributes(uint64 handle) const /*override*/;
319
320 virtual ::std::optional<::PlayingSoundAttributes>
321 tryGetPlayingSoundAttributes(::ServerSoundHandle serverSoundHandle) const /*override*/;
322
323 virtual ::std::optional<::LoopingSoundAttributes> tryGetLoopingSoundAttributes(uint64 handle) const /*override*/;
324
325 virtual uint64 playOnlineMusic(
326 ::std::string const& eventName,
327 ::WeakRef<::Audio::OnlineAudioStream> stream,
328 float volume,
329 ::Audio::SoundStartOptions startOptions
330 ) /*override*/;
331
332 virtual uint64 playOnlineMusic(
333 ::std::string const& eventName,
334 ::SoundItem const& soundItem,
335 ::WeakRef<::Audio::OnlineAudioStream> stream,
336 ::Audio::SoundStartOptions startOptions
337 ) /*override*/;
338
339 virtual uint64 playOnlineSound(
340 ::WeakRef<::Audio::OnlineAudioStream> stream,
341 float volume,
342 float pitch,
343 ::Audio::SoundStartOptions startOptions
344 ) /*override*/;
345
346 virtual uint64 playOnlineSound(
347 ::SoundEvent const& soundEvent,
348 ::SoundItem const& soundItem,
349 ::WeakRef<::Audio::OnlineAudioStream> stream,
350 ::PlaySoundOptions const& options,
351 ::Audio::SoundStartOptions startOptions
352 ) /*override*/;
353
354 virtual uint64 createRawUISoundStream(int bitDepth, int channels, float samplingRate) /*override*/;
355
356 virtual void closeRawUISoundStream(uint64 handle) /*override*/;
357
358 virtual void playRawUISoundStream(uint64 handle) /*override*/;
359
360 virtual void pauseRawUISoundStream(uint64 handle) /*override*/;
361
362 virtual void feedRawUISoundStream(uint64 handle, int samples, float** pcm, int channels) /*override*/;
363
364 virtual void endRawUISoundStream(uint64 handle) /*override*/;
365
366 virtual void setRawUISoundStreamVolume(uint64 handle, float volume) /*override*/;
367
368 virtual void flushRawUISoundStreamData(uint64 handle) /*override*/;
369
370 virtual bool _createSystem();
371
372 virtual bool _initSystem();
373
374 virtual void _updateSystem(float elapsedTime);
375
376 virtual void _destroySystem();
377
378 virtual void _updateListenerAttributes();
379
380 virtual void _setPositionalAttributes(
381 ::FMOD::Channel* channel,
382 ::FMOD::Sound* sound,
383 ::FMOD::Sound* soundToPlay,
384 float x,
385 float y,
386 float z,
387 float volume
388 );
389 // NOLINTEND
390
391public:
392 // member functions
393 // NOLINTBEGIN
394 MCNAPI SoundSystemFMOD(
395 ::ResourceLoader& resourceLoader,
396 ::std::unique_ptr<::Audio::IAudioAssetProvider const> audioAssetProvider,
397 ::Core::Path const& tempFolderPath,
398 ::Core::Path const& dataUrl,
399 uint64 threadMask
400 );
401
402 MCNAPI void _loadSoundAsync(
403 ::SoundItem const& soundItem,
404 ::SoundCacheKeyFMOD soundCacheKey,
405 ::std::weak_ptr<::DiskSoundSourceFMOD> weakSoundSource
406 );
407
408 MCNAPI void _loadSoundAsync(
409 ::Core::Path const& soundPath,
410 ::std::unique_ptr<::Audio::IStreamableAudioAsset> streamableAudioAsset,
411 ::SoundCacheKeyFMOD soundCacheKey,
412 ::std::weak_ptr<::DiskSoundSourceFMOD> weakSoundSource
413 );
414
415 MCNAPI uint64 _playAt(
416 ::Core::Path const& soundPath,
417 ::SoundEvent const* soundEvent,
418 ::std::string const& eventName,
419 uint64 soundHandle,
420 float x,
421 float y,
422 float z,
423 float volume,
424 float pitch,
425 bool is3D,
426 float minDistance,
427 float maxDistance,
428 bool useLegacyMaxDistance,
429 bool isTTS,
430 ::std::optional<::ServerSoundHandle> serverSoundHandle,
431 int loopCount,
432 float volumeBase,
433 int channelPriority
434 );
435
436 MCNAPI uint64 _playEvent(
437 ::SoundEvent const& soundEvent,
438 ::std::string const& eventName,
439 float volumeScalar,
440 float pitchScalar,
441 bool is2D,
442 float x,
443 float y,
444 float z,
445 ::std::optional<::ServerSoundHandle> serverSoundHandle,
446 int loopCount,
447 ::std::optional<float> playbackPositionSeconds,
448 int channelPriority
449 );
450 // NOLINTEND
451
452public:
453 // constructor thunks
454 // NOLINTBEGIN
455 MCNAPI void* $ctor(
456 ::ResourceLoader& resourceLoader,
457 ::std::unique_ptr<::Audio::IAudioAssetProvider const> audioAssetProvider,
458 ::Core::Path const& tempFolderPath,
459 ::Core::Path const& dataUrl,
460 uint64 threadMask
461 );
462 // NOLINTEND
463
464public:
465 // virtual function thunks
466 // NOLINTBEGIN
467 MCNAPI bool $preinit();
468
469 MCNAPI void $init();
470
471 MCNAPI void $destroy();
472
473 MCNAPI void $setOutputDevice(::SoundSystemGUID& outputDevice);
474
475 MCNAPI void $setAsyncLoadFunction(::std::function<void(::SoundLoadTask)> asyncLoad);
476
477 MCNAPI void $enable(bool status);
478
479 MCNAPI void $mute(bool muted);
480
481 MCNAPI bool $addListener(int const handle);
482
483 MCNAPI void $removeListener(int const handle);
484
485 MCNAPI void $setMainVolume(float vol);
486
487 MCNAPI void $setMusicVolume(float vol);
488
489 MCNAPI void $setSoundVolume(float vol);
490
491 MCNAPI void $setSoundCategoryVolume(::std::string const& category, float vol);
492
493 MCNAPI void $setTTSVolume(float vol);
494
496 ::Core::Path const& soundPath,
497 char const* data,
498 uint64 dataSize,
499 int numchannels,
500 int defaultfrequency,
501 ::SoundFormat format
502 );
503
504 MCNAPI bool $loadFromMemory(::Core::Path const& soundPath, char const* data, uint64 dataSize);
505
506 MCNAPI void $unload(::Core::Path const& soundPath);
507
508 MCNAPI void $unloadAllExcept(::std::vector<::Core::PathBuffer<::std::string>> const& exceptions);
509
510 MCNAPI void $stop(::std::string const& eventName);
511
512 MCNAPI void $stop(uint64 handle);
513
514 MCNAPI void $stop(::ServerSoundHandle serverSoundHandle);
515
516 MCNAPI void $setVolume(::ServerSoundHandle serverSoundHandle, float volume);
517
518 MCNAPI void $setPitch(::ServerSoundHandle serverSoundHandle, float pitch);
519
520 MCNAPI void $fade(::ServerSoundHandle serverSoundHandle, float duration, float targetVolume);
521
522 MCNAPI void $setPlaybackPosition(::ServerSoundHandle serverSoundHandle, float seconds);
523
524 MCNAPI void $setPlaybackPosition(uint64 soundHandle, float seconds);
525
526 MCNAPI void $pause(::ServerSoundHandle serverSoundHandle, ::SoundPauseSource source);
527
528 MCNAPI void $pause(uint64 soundHandle, ::SoundPauseSource source);
529
530 MCNAPI void $resume(::ServerSoundHandle serverSoundHandle, ::SoundPauseSource source);
531
532 MCNAPI void $resume(uint64 soundHandle, ::SoundPauseSource source);
533
534 MCNAPI void $signalStart(uint64 soundHandle);
535
536 MCNAPI void $stopAllSounds();
537
538 MCNAPI void $pauseAllPlayingSounds(::SoundPauseSource source);
539
540 MCNAPI void $resumeAllPreviouslyPlayingSounds(::SoundPauseSource source);
541
542 MCNAPI void $fadeOut(uint64 handle, float duration) const;
543
544 MCNAPI uint64 $playEvent(::SoundEvent const& soundEvent, ::std::string const& eventName, float volume, float pitch);
545
546 MCNAPI uint64 $playEventAt(
547 ::SoundEvent const& soundEvent,
548 ::std::string const& eventName,
549 float x,
550 float y,
551 float z,
552 float volume,
553 float pitch,
554 ::std::optional<::ServerSoundHandle> serverSoundHandle
555 );
556
557 MCNAPI uint64 $playEventAt(::SoundEvent const& soundEvent, ::PlaySoundOptions const& options);
558
560 ::SoundEvent const& soundEvent,
561 ::SoundItem const& soundItem,
562 ::std::unique_ptr<::Audio::IStreamableAudioAsset> streamableAudioAsset,
563 ::PlaySoundOptions const& options
564 );
565
566 MCNAPI uint64 $playEventAttached(
567 ::SoundEvent const& soundEvent,
568 ::std::string const& eventName,
569 ::std::function<void(::SoundInstanceProperties&)>&& getSoundProperties
570 );
571
572 MCNAPI uint64 $playAt(
573 ::Core::Path const& soundPath,
574 ::SoundEvent const* soundEvent,
575 ::std::string const& eventName,
576 uint64 soundHandle,
577 float x,
578 float y,
579 float z,
580 float volume,
581 float pitch,
582 bool is3D,
583 float minDistance,
584 float maxDistance,
585 bool useLegacyMaxDistance,
586 bool isTTS,
587 ::std::optional<::ServerSoundHandle> serverSoundHandle,
588 int loopCount,
589 float volumeBase
590 );
591
592 MCNAPI void $playMusic(::PlayMusicOptions options, ::SoundItem const& soundItem);
593
594 MCNAPI uint64 $playStreamableMusic(
595 ::std::string const& eventName,
596 ::SoundItem const& soundItem,
597 ::std::unique_ptr<::Audio::IStreamableAudioAsset> streamableAudioAsset
598 );
599
600 MCNAPI void $pauseMusic(bool paused);
601
602 MCNAPI void $stopMusic();
603
604 MCNAPI void $fadeMusicOut(float time);
605
606 MCNAPI bool $isMusicChannelPlaying() const;
607
608 MCNAPI bool $isPlayingMusicEvent(::std::string const& eventName) const;
609
610 MCNAPI bool $isPlayingMusic(::Core::PathView soundPath) const;
611
612 MCNAPI bool $isLoadingMusic() const;
613
614 MCNAPI void $cancelLoadMusic();
615
616 MCNAPI ::Core::PathView $getCurrentlyPlayingMusicPath() const;
617
618 MCNAPI ::std::string $getCurrentlyPlayingEventName() const;
619
620 MCNAPI void $update(float elapsedTime);
621
622 MCNAPI void $playSound(
623 float x,
624 float y,
625 float z,
626 float volume,
627 float pitch,
628 ::FMOD::ChannelGroup* channelGroup,
629 ::FMOD::Channel*& channel,
630 ::FMOD::Sound*& soundToPlay,
631 bool is3D,
632 float minDistance,
633 float maxDistance,
634 bool useLegacyMaxDistance,
635 int loopCount
636 );
637
638 MCNAPI ::FMOD::Sound* $getFirstSubSound(::std::shared_ptr<::FMOD::Sound> const& sound) const;
639
640 MCNAPI bool $isPlayingSound(uint64 handle) const;
641
642 MCNAPI bool $isPlayingSound(::Core::Path const& soundPath) const;
643
644 MCNAPI bool $isPlayingSound(::ServerSoundHandle serverSoundHandle) const;
645
646 MCNAPI bool $isSoundActive(uint64 handle) const;
647
648 MCNAPI bool $wasSoundStoppedExplicitly(::ServerSoundHandle serverSoundHandle) const;
649
650 MCNAPI uint64 $registerLoop(
651 ::SoundItem const& soundItem,
652 ::std::weak_ptr<::SoundEvent> const soundEvent,
653 ::std::string const& eventName,
654 ::std::function<void(::LoopingSoundState&)> getSoundState,
655 float fadeInDuration,
656 float fadeOutDuration
657 );
658
659 MCNAPI void $unregisterLoop(uint64 handle, bool hard);
660
661 MCNAPI void $displayDebugStats(::std::string& debugOutputFormat) const;
662
663 MCNAPI uint64 $getNewSoundHandle();
664
665 MCNAPI ::std::optional<::PlayingSoundAttributes> $tryGetPlayingSoundAttributes(uint64 handle) const;
666
667 MCNAPI ::std::optional<::PlayingSoundAttributes>
669
670 MCNAPI ::std::optional<::LoopingSoundAttributes> $tryGetLoopingSoundAttributes(uint64 handle) const;
671
672 MCNAPI uint64 $playOnlineMusic(
673 ::std::string const& eventName,
674 ::WeakRef<::Audio::OnlineAudioStream> stream,
675 float volume,
676 ::Audio::SoundStartOptions startOptions
677 );
678
679 MCNAPI uint64 $playOnlineMusic(
680 ::std::string const& eventName,
681 ::SoundItem const& soundItem,
682 ::WeakRef<::Audio::OnlineAudioStream> stream,
683 ::Audio::SoundStartOptions startOptions
684 );
685
686 MCNAPI uint64 $playOnlineSound(
687 ::WeakRef<::Audio::OnlineAudioStream> stream,
688 float volume,
689 float pitch,
690 ::Audio::SoundStartOptions startOptions
691 );
692
693 MCNAPI uint64 $playOnlineSound(
694 ::SoundEvent const& soundEvent,
695 ::SoundItem const& soundItem,
696 ::WeakRef<::Audio::OnlineAudioStream> stream,
697 ::PlaySoundOptions const& options,
698 ::Audio::SoundStartOptions startOptions
699 );
700
701 MCNAPI uint64 $createRawUISoundStream(int bitDepth, int channels, float samplingRate);
702
703 MCNAPI void $closeRawUISoundStream(uint64 handle);
704
705 MCNAPI void $playRawUISoundStream(uint64 handle);
706
707 MCNAPI void $pauseRawUISoundStream(uint64 handle);
708
709 MCNAPI void $feedRawUISoundStream(uint64 handle, int samples, float** pcm, int channels);
710
711 MCNAPI void $endRawUISoundStream(uint64 handle);
712
713 MCNAPI void $setRawUISoundStreamVolume(uint64 handle, float volume);
714
715 MCNAPI void $flushRawUISoundStreamData(uint64 handle);
716
717 MCNAPI bool $_createSystem();
718
719 MCNAPI bool $_initSystem();
720
721 MCNAPI void $_updateSystem(float elapsedTime);
722
723 MCNAPI void $_destroySystem();
724
726
728 ::FMOD::Channel* channel,
729 ::FMOD::Sound* sound,
730 ::FMOD::Sound* soundToPlay,
731 float x,
732 float y,
733 float z,
734 float volume
735 );
736 // NOLINTEND
737};
Definition IAudioAssetProvider.h:7
Definition IStreamableAudioAsset.h:10
Definition OnlineAudioStream.h:7
Definition SoundStartOptions.h:7
Definition PathView.h:19
Definition Path.h:10
Definition DiskSoundSourceFMOD.h:5
Definition FMODSoundReleaseQueue.h:5
Definition ChannelGroup.h:7
Definition Channel.h:7
Definition Sound.h:7
Definition System.h:7
Definition Path.h:16
Definition ResourceLoader.h:16
Definition ServerSoundHandle.h:5
Definition SoundCacheFMOD.h:5
Definition SoundCacheKeyFMOD.h:5
Definition SoundEvent.h:10
Definition SoundItem.h:5
Definition SoundSystemBase.h:31
Definition SoundSystemFMOD.h:5
MCAPI void $pauseMusic(bool paused)
MCAPI void $_setPositionalAttributes(::FMOD::Channel *channel, ::FMOD::Sound *sound, ::FMOD::Sound *soundToPlay, float x, float y, float z, float volume)
MCAPI void $removeListener(int const handle)
MCAPI uint64 $playEvent(::SoundEvent const &soundEvent, ::std::string const &eventName, float volume, float pitch)
MCAPI void $displayDebugStats(::std::string &debugOutputFormat) const
MCAPI void $enable(bool status)
MCAPI void $closeRawUISoundStream(uint64 handle)
MCAPI ::std::optional<::PlayingSoundAttributes > $tryGetPlayingSoundAttributes(uint64 handle) const
MCAPI void $playRawUISoundStream(uint64 handle)
MCAPI::Core::PathView $getCurrentlyPlayingMusicPath() const
MCAPI void $destroy()
MCAPI void $setPitch(::ServerSoundHandle serverSoundHandle, float pitch)
MCAPI bool $isMusicChannelPlaying() const
MCAPI uint64 $playStreamableMusic(::std::string const &eventName, ::SoundItem const &soundItem, ::std::unique_ptr<::Audio::IStreamableAudioAsset > streamableAudioAsset)
MCAPI void $setSoundVolume(float vol)
MCAPI void $fade(::ServerSoundHandle serverSoundHandle, float duration, float targetVolume)
MCAPI uint64 _playAt(::Core::Path const &soundPath, ::SoundEvent const *soundEvent, ::std::string const &eventName, uint64 soundHandle, float x, float y, float z, float volume, float pitch, bool is3D, float minDistance, float maxDistance, bool useLegacyMaxDistance, bool isTTS, ::std::optional<::ServerSoundHandle > serverSoundHandle, int loopCount, float volumeBase, int channelPriority)
MCAPI void $pauseAllPlayingSounds(::SoundPauseSource source)
MCAPI bool $_createSystem()
MCAPI void $init()
MCAPI void $setOutputDevice(::SoundSystemGUID &outputDevice)
MCAPI uint64 $playEventAt(::SoundEvent const &soundEvent, ::std::string const &eventName, float x, float y, float z, float volume, float pitch, ::std::optional<::ServerSoundHandle > serverSoundHandle)
MCAPI bool $isSoundActive(uint64 handle) const
MCAPI bool $isPlayingSound(uint64 handle) const
MCAPI void $pauseRawUISoundStream(uint64 handle)
MCAPI void $unregisterLoop(uint64 handle, bool hard)
MCAPI bool $loadFromMemory(::Core::Path const &soundPath, char const *data, uint64 dataSize)
MCAPI::FMOD::Sound * $getFirstSubSound(::std::shared_ptr<::FMOD::Sound > const &sound) const
MCAPI void $_destroySystem()
MCAPI bool $wasSoundStoppedExplicitly(::ServerSoundHandle serverSoundHandle) const
MCAPI void $stop(::std::string const &eventName)
MCAPI void $fadeOut(uint64 handle, float duration) const
MCAPI void $flushRawUISoundStreamData(uint64 handle)
MCAPI uint64 _playEvent(::SoundEvent const &soundEvent, ::std::string const &eventName, float volumeScalar, float pitchScalar, bool is2D, float x, float y, float z, ::std::optional<::ServerSoundHandle > serverSoundHandle, int loopCount, ::std::optional< float > playbackPositionSeconds, int channelPriority)
MCAPI void $signalStart(uint64 soundHandle)
MCAPI void $stopMusic()
MCAPI bool $isLoadingMusic() const
MCAPI void $setVolume(::ServerSoundHandle serverSoundHandle, float volume)
MCAPI void $setRawUISoundStreamVolume(uint64 handle, float volume)
MCAPI void $cancelLoadMusic()
MCAPI void $setMainVolume(float vol)
MCAPI void $setTTSVolume(float vol)
MCAPI uint64 $getNewSoundHandle()
MCAPI void $mute(bool muted)
MCAPI void $_updateListenerAttributes()
MCAPI bool $loadRawFromMemory(::Core::Path const &soundPath, char const *data, uint64 dataSize, int numchannels, int defaultfrequency, ::SoundFormat format)
MCAPI ::std::optional<::LoopingSoundAttributes > $tryGetLoopingSoundAttributes(uint64 handle) const
MCAPI bool $preinit()
MCAPI::std::string $getCurrentlyPlayingEventName() const
MCAPI void $playMusic(::PlayMusicOptions options, ::SoundItem const &soundItem)
MCAPI void _loadSoundAsync(::SoundItem const &soundItem, ::SoundCacheKeyFMOD soundCacheKey, ::std::weak_ptr<::DiskSoundSourceFMOD > weakSoundSource)
MCAPI void $resume(::ServerSoundHandle serverSoundHandle, ::SoundPauseSource source)
MCAPI bool $isPlayingMusicEvent(::std::string const &eventName) const
MCAPI void $fadeMusicOut(float time)
MCAPI void $endRawUISoundStream(uint64 handle)
MCAPI void $stopAllSounds()
MCAPI void $feedRawUISoundStream(uint64 handle, int samples, float **pcm, int channels)
MCAPI void $setSoundCategoryVolume(::std::string const &category, float vol)
MCAPI void $update(float elapsedTime)
MCAPI uint64 $playOnlineSound(::WeakRef<::Audio::OnlineAudioStream > stream, float volume, float pitch, ::Audio::SoundStartOptions startOptions)
MCAPI uint64 $playEventAttached(::SoundEvent const &soundEvent, ::std::string const &eventName, ::std::function< void(::SoundInstanceProperties &)> &&getSoundProperties)
MCAPI uint64 $registerLoop(::SoundItem const &soundItem, ::std::weak_ptr<::SoundEvent > const soundEvent, ::std::string const &eventName, ::std::function< void(::LoopingSoundState &)> getSoundState, float fadeInDuration, float fadeOutDuration)
MCAPI uint64 $playStreamableEventAt(::SoundEvent const &soundEvent, ::SoundItem const &soundItem, ::std::unique_ptr<::Audio::IStreamableAudioAsset > streamableAudioAsset, ::PlaySoundOptions const &options)
MCAPI void * $ctor(::ResourceLoader &resourceLoader, ::std::unique_ptr<::Audio::IAudioAssetProvider const > audioAssetProvider, ::Core::Path const &tempFolderPath, ::Core::Path const &dataUrl, uint64 threadMask)
MCAPI bool $addListener(int const handle)
MCAPI void $pause(::ServerSoundHandle serverSoundHandle, ::SoundPauseSource source)
MCAPI void $unloadAllExcept(::std::vector<::Core::PathBuffer<::std::string > > const &exceptions)
MCAPI void $setMusicVolume(float vol)
MCAPI void $setAsyncLoadFunction(::std::function< void(::SoundLoadTask)> asyncLoad)
MCAPI bool $isPlayingMusic(::Core::PathView soundPath) const
MCAPI void $_updateSystem(float elapsedTime)
MCAPI void $resumeAllPreviouslyPlayingSounds(::SoundPauseSource source)
MCAPI void $setPlaybackPosition(::ServerSoundHandle serverSoundHandle, float seconds)
MCAPI uint64 $createRawUISoundStream(int bitDepth, int channels, float samplingRate)
MCAPI bool $_initSystem()
MCAPI uint64 $playAt(::Core::Path const &soundPath, ::SoundEvent const *soundEvent, ::std::string const &eventName, uint64 soundHandle, float x, float y, float z, float volume, float pitch, bool is3D, float minDistance, float maxDistance, bool useLegacyMaxDistance, bool isTTS, ::std::optional<::ServerSoundHandle > serverSoundHandle, int loopCount, float volumeBase)
MCAPI void $unload(::Core::Path const &soundPath)
MCAPI void $playSound(float x, float y, float z, float volume, float pitch, ::FMOD::ChannelGroup *channelGroup, ::FMOD::Channel *&channel, ::FMOD::Sound *&soundToPlay, bool is3D, float minDistance, float maxDistance, bool useLegacyMaxDistance, int loopCount)
MCAPI uint64 $playOnlineMusic(::std::string const &eventName, ::WeakRef<::Audio::OnlineAudioStream > stream, float volume, ::Audio::SoundStartOptions startOptions)
Definition WeakRef.h:8
STL namespace.
Definition LoopingSoundAttributes.h:8
Definition LoopingSoundState.h:5
Definition PlayMusicOptions.h:5
Definition PlaySoundOptions.h:10
Definition PlayingSoundAttributes.h:5
Definition SoundInstanceProperties.h:5
Definition SoundLoadTask.h:5
Definition SoundSystemFMOD.h:13
Definition SoundSystemGUID.h:5
Definition Sound.h:5