Logo
Sound.h
1#pragma once
2
3#include "Types.h"
4#include "snd/Sound.h"
5#include "Math/Vector3.h"
6
7namespace XXSharpKmyAudio
8{
9 private enum class SurroundMode {
10 None,
12 Planar,
13 };
14
15 private enum class VolumeRollOffType {
16 Fix,
17 Linear,
19 };
20
21 private ref class Sound
22 {
23 private:
24 int sePlayerId = -1;
25 u32 pausePos = 0;
26 int typeIndex;
27 float pan;
28 float volume;
29 float tempo;
30 bool loop;
31 bool is3D = false;
32 float x;
33 float y;
34 float z;
35
36
37 public:
38 kmySound::WaveSound *obj = NULL;
39 void Release()
40 {
41 if (obj)
42 obj->unref();
43 obj = NULL;
44 }
45
46 static Sound^ load(System::String ^path);
47
48 bool play(SurroundMode surroundMode, VolumeRollOffType volumeRollOff, float minimumDistance, float maximumDistance);
49 bool play(bool loop, int typeIndex, SurroundMode surroundMode, VolumeRollOffType volumeRollOff, float minimumDistance, float maximumDistance);
50 void stop();
51 void pause();
52 void setLoopInfo(int start, int end);
53 void setPan(float pan);
54 void setVolume(float volume);
55 void setTempo(float tempo);
56 float getPan() { return pan; }
57 float getVolume() { return volume; }
58 float getTempo() { return tempo; }
59 void setPosition(XXSharpKmyMath::Vector3 ^pos);
60 bool isPlaying();
61 bool isAvailable();
62
63 cli::array<s16> ^getWaveform();
64 u32 getSamplingRate() { return (obj == nullptr) ? 0 : obj->getSamplingRate(); }
65 int getChannelCount() { return (obj == nullptr) ? 0 : obj->getChannelCount(); }
66
67 static void initializeSETypeCount(cli::array<int>^ seCounts);
68 static void setListenerMatrix(XXSharpKmyMath::Matrix4 mtx);
69 static void setDistanceScaleMaxDistance(float distanceOfZeroVolume);
70 };
71}
VolumeRollOffType
Definition: Sound.cs:15
SurroundMode
Definition: Sound.cs:8