Compare commits

..

18 Commits

Author SHA1 Message Date
cosmonaut 3b39ed9d10 fix possible race condition in OnBufferEndCallback 2021-12-15 14:24:00 -08:00
cosmonaut 4a3d2e25d4 load OGG into memory to avoid disk bottleneck 2021-12-14 19:57:45 -08:00
cosmonaut 30cb6959e0 add 3d orientation API 2021-11-29 10:45:08 -08:00
cosmonaut 90250633de add play sync API 2021-11-24 11:26:02 -08:00
cosmonaut 5365f8993f fix debug build settings 2021-11-24 10:55:38 -08:00
cosmonaut d3708f5e16 tweak stream loop behavior 2021-11-24 10:55:24 -08:00
cosmonaut e12914177f tweak stream looping behavior 2021-11-18 12:35:31 -08:00
cosmonaut e17d7e0da8 streaming sounds triple buffer to avoid micro stutter 2021-11-18 12:13:57 -08:00
cosmonaut c6e3879a67 load wav with SDL + fix building and linking 2021-11-17 22:10:31 -08:00
cosmonaut 6d8c80064c refactor effect chains to use a single voice 2021-11-16 23:06:44 -08:00
cosmonaut 4e1f53ce03 update windows dll 2021-11-16 00:43:17 -08:00
cosmonaut 1d3c0dcbc8 fix bug with SetLoop while Playing 2021-11-16 00:24:49 -08:00
cosmonaut 3568028dc3 change destroyOnFinish behavior to use OnBufferEnd 2021-11-11 14:45:21 -08:00
cosmonaut 6edd9ebc94 typo lmao 2021-11-09 15:37:57 -08:00
cosmonaut 0e04346b8c fix effect chains making sounds mono 2021-11-09 15:32:22 -08:00
cosmonaut 22d759ea11 fix sounds that use reverb being destroyed too early 2021-11-09 15:09:47 -08:00
cosmonaut 4d834b3567 add clang formatting 2021-11-08 16:15:49 -08:00
Nikita Krapivin 2fd95ea452 Update Android support once again and add a Windows NDK build script. (#1)
Co-authored-by: Nikita Krapivin <alienoom@yandex.ru>
Reviewed-on: MoonsideGames/FAudioGMS#1
Co-authored-by: Nikita Krapivin <nik@noreply.example.org>
Co-committed-by: Nikita Krapivin <nik@noreply.example.org>
2021-11-08 18:26:46 +00:00
24 changed files with 1284 additions and 8679 deletions

166
.clang-format Normal file
View File

@ -0,0 +1,166 @@
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: AlwaysBreak
AlignConsecutiveMacros: None
AlignConsecutiveAssignments: None
AlignConsecutiveBitFields: None
AlignConsecutiveDeclarations: None
AlignEscapedNewlines: Right
AlignOperands: Align
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: false
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortEnumsOnASingleLine: true
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: MultiLine
AttributeMacros:
- __capability
BinPackArguments: false
BinPackParameters: false
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: Never
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeConceptDeclarations: true
BreakBeforeBraces: Allman
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 100
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DeriveLineEnding: true
DerivePointerAlignment: false
DisableFormat: false
EmptyLineBeforeAccessModifier: LogicalBlock
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
StatementAttributeLikeMacros:
- Q_EMIT
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
SortPriority: 0
CaseSensitive: false
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
SortPriority: 0
CaseSensitive: false
- Regex: '.*'
Priority: 1
SortPriority: 0
CaseSensitive: false
IncludeIsMainRegex: '(Test)?$'
IncludeIsMainSourceRegex: ''
IndentCaseLabels: false
IndentCaseBlocks: false
IndentGotoLabels: true
IndentPPDirectives: None
IndentExternBlock: NoIndent
IndentRequires: false
IndentWidth: 4
IndentWrappedFunctionNames: false
InsertTrailingCommas: None
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 4
ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 1000000
PenaltyIndentedWhitespace: 0
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SortJavaStaticImport: Before
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceAroundPointerQualifiers: Default
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false
BitFieldColonSpacing: Both
Standard: Latest
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 8
UseCRLF: false
UseTab: Never
WhitespaceSensitiveMacros:
- STRINGIZE
- PP_STRINGIZE
- BOOST_PP_STRINGIZE
- NS_SWIFT_NAME
- CF_SWIFT_NAME
...

View File

@ -63,6 +63,7 @@ LOCAL_MODULE := FAudioGMS
# Tell ndk-build we rely on these two fellas:
LOCAL_SHARED_LIBRARIES := SDL2 FAudio_static
LOCAL_C_INCLUDES := $(SDL_PATH)/include $(FAUDIO_PATH)/include $(FAUDIOGMS_PATH)/src
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)
LOCAL_SRC_FILES := $(FAUDIOGMS_PATH)/src/FAudioGMS.c $(LOCAL_PATH)/FAudioGMS_JNI.c
include $(BUILD_SHARED_LIBRARY)

View File

@ -27,6 +27,11 @@
/* These are the Native -> JNI conv wrappers, they must only be built for Android */
#ifdef __ANDROID__
/* no mangling please */
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include <jni.h>
#include <FAudioGMS.h>
@ -103,9 +108,9 @@ Java_org_screwyoyo_faudiogms_FAudioGMSNative_FAudioGMS_1StreamingSound_1LoadOGG
JNIEXPORT jdouble JNICALL
Java_org_screwyoyo_faudiogms_FAudioGMSNative_FAudioGMS_1SoundInstance_1Play
(JNIEnv* jniEnv, jclass jniThis, jdouble _soundInstanceID, jdouble _loop)
(JNIEnv* jniEnv, jclass jniThis, jdouble _soundInstanceID)
{
FAudioGMS_SoundInstance_Play(_soundInstanceID, _loop);
FAudioGMS_SoundInstance_Play(_soundInstanceID);
return NOTHING;
}
@ -125,6 +130,22 @@ Java_org_screwyoyo_faudiogms_FAudioGMSNative_FAudioGMS_1SoundInstance_1Stop
return NOTHING;
}
JNIEXPORT jdouble JNICALL
Java_org_screwyoyo_faudiogms_FAudioGMSNative_FAudioGMS_1SoundInstance_1SetPlayRegion
(JNIEnv* jniEnv, jclass jniThis, jdouble _soundInstanceID, jdouble _startInMilliseconds, jdouble _endInMilliseconds)
{
FAudioGMS_SoundInstance_SetPlayRegion(_soundInstanceID, _startInMilliseconds, _endInMilliseconds);
return NOTHING;
}
JNIEXPORT jdouble JNICALL
Java_org_screwyoyo_faudiogms_FAudioGMSNative_FAudioGMS_1SoundInstance_1SetLoop
(JNIEnv* jniEnv, jclass jniThis, jdouble _soundInstanceID, jdouble _loop)
{
FAudioGMS_SoundInstance_SetLoop(_soundInstanceID, _loop);
return NOTHING;
}
JNIEXPORT jdouble JNICALL
Java_org_screwyoyo_faudiogms_FAudioGMSNative_FAudioGMS_1SoundInstance_1SetPan
(JNIEnv* jniEnv, jclass jniThis, jdouble _soundInstanceID, jdouble _pan)
@ -205,6 +226,14 @@ Java_org_screwyoyo_faudiogms_FAudioGMSNative_FAudioGMS_1SoundInstance_1SetBandPa
return NOTHING;
}
JNIEXPORT jdouble JNICALL
Java_org_screwyoyo_faudiogms_FAudioGMSNative_FAudioGMS_1SoundInstance_1QueueSoundInstance
(JNIEnv* jniEnv, jclass jniThis, jdouble _soundInstanceID, jdouble _queueSoundInstanceID)
{
FAudioGMS_SoundInstance_QueueSoundInstance(_soundInstanceID, _queueSoundInstanceID);
return NOTHING;
}
JNIEXPORT jdouble JNICALL
Java_org_screwyoyo_faudiogms_FAudioGMSNative_FAudioGMS_1SoundInstance_1GetPitch
(JNIEnv* jniEnv, jclass jniThis, jdouble _soundInstanceID)
@ -327,6 +356,22 @@ Java_org_screwyoyo_faudiogms_FAudioGMSNative_FAudioGMS_1SoundInstance_1SetEffect
return NOTHING;
}
JNIEXPORT jdouble JNICALL
Java_org_screwyoyo_faudiogms_FAudioGMSNative_FAudioGMS_1SetMasteringEffectChain
(JNIEnv* jniEnv, jclass jniThis, jdouble _effectChainID, double _effectGain)
{
FAudioGMS_SetMasteringEffectChain(_effectChainID, _effectGain);
return NOTHING;
}
JNIEXPORT jdouble JNICALL
Java_org_screwyoyo_faudiogms_FAudioGMSNative_FAudioGMS_1SetMasteringEffectGain
(JNIEnv* jniEnv, jclass jniThis, jdouble _effectGain)
{
FAudioGMS_SetMasteringEffectGain(_effectGain);
return NOTHING;
}
JNIEXPORT jdouble JNICALL
Java_org_screwyoyo_faudiogms_FAudioGMSNative_FAudioGMS_1SetListenerPosition
(JNIEnv* jniEnv, jclass jniThis, jdouble _x, jdouble _y, jdouble _z)
@ -383,6 +428,10 @@ Java_org_screwyoyo_faudiogms_FAudioGMSNative_FAudioGMS_1Destroy
return NOTHING;
}
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __ANDROID__ */
/* Do nothing for other platforms, because they, thankly, do not require JNI bindings... */

8
android/build.ndk.cmd Normal file
View File

@ -0,0 +1,8 @@
cd /d %~dp0
mkdir buildandroid
call ndk-build NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=Android.mk APP_ABI="armeabi-v7a arm64-v8a x86 x86_64" APP_PLATFORM=android-16 APP_MODULES="SDL2 FAudio_static FAudioGMS" NDK_OUT=buildandroid\obj NDK_LIBS_OUT=buildandroid\lib
xcopy /e /r /y buildandroid\lib ..\gamemaker\extensions\FAudioGMS\AndroidSource\libs
rd /s /q buildandroid

View File

@ -22,12 +22,14 @@ import android.content.res.AssetManager;
public class FAudioGMSBridge extends FAudioGMSNative implements IExtensionBase
{
public SDLActivity sdl;
public boolean paused;
public boolean handlenativepause; /* automatically pause all sounds on onPause or not? */
public boolean paused; /* are we currently paused */
public FAudioGMSBridge()
{
super();
paused = false;
handlenativepause = true; /* set this to false if you wish to handle pauses manually */
paused = false; /* this one must be false at initialization */
SDL.setContext(RunnerJNILib.GetApplicationContext());
sdl = new SDLActivity();
}
@ -62,7 +64,7 @@ public class FAudioGMSBridge extends FAudioGMSNative implements IExtensionBase
public void onPause()
{
sdl.onPause();
if (!paused)
if (handlenativepause && !paused)
{
paused = true;
FAudioGMS_PauseAll();
@ -72,7 +74,7 @@ public class FAudioGMSBridge extends FAudioGMSNative implements IExtensionBase
public void onResume()
{
sdl.onResume();
if (paused)
if (handlenativepause && paused)
{
paused = false;
FAudioGMS_ResumeAll();

View File

@ -18,10 +18,12 @@ public class FAudioGMSNative
public native double FAudioGMS_StreamingSound_LoadOGG(String filepath);
public native double FAudioGMS_SoundInstance_Play(double soundInstanceID, double loop);
public native double FAudioGMS_SoundInstance_Play(double soundInstanceID);
public native double FAudioGMS_SoundInstance_Pause(double soundInstanceID);
public native double FAudioGMS_SoundInstance_Stop(double soundInstanceID);
public native double FAudioGMS_SoundInstance_SetPlayRegion(double soundInstanceID, double startInMilliseconds, double endInMilliseconds);
public native double FAudioGMS_SoundInstance_SetLoop(double soundInstanceID, double loop);
public native double FAudioGMS_SoundInstance_SetPan(double soundInstanceID, double pan);
public native double FAudioGMS_SoundInstance_SetPitch(double soundInstanceID, double pitch);
public native double FAudioGMS_SoundInstance_SetVolume(double soundInstanceID, double volume);
@ -33,6 +35,8 @@ public class FAudioGMSNative
public native double FAudioGMS_SoundInstance_SetHighPassFilter(double soundInstanceID, double highPassFilter, double Q);
public native double FAudioGMS_SoundInstance_SetBandPassFilter(double soundInstanceID, double bandPassFilter, double Q);
public native double FAudioGMS_SoundInstance_QueueSoundInstance(double soundInstanceID, double queueSoundInstanceID);
public native double FAudioGMS_SoundInstance_GetPitch(double soundInstanceID);
public native double FAudioGMS_SoundInstance_GetVolume(double soundInstanceID);
public native double FAudioGMS_SoundInstance_GetTrackLengthInSeconds(double soundInstanceID);
@ -69,6 +73,9 @@ public class FAudioGMSNative
public native double FAudioGMS_SoundInstance_SetEffectChain(double soundInstanceID, double effectChainID, double effectGain);
public native double FAudioGMS_SoundInstance_SetEffectGain(double soundInstanceID, double effectGain);
public native double FAudioGMS_SetMasteringEffectChain(double effectChainID, double effectGain);
public native double FAudioGMS_SetMasteringEffectGain(double effectGain);
public native double FAudioGMS_SetListenerPosition(double x, double y, double z);
public native double FAudioGMS_SetListenerVelocity(double xVelocity, double yVelocity, double zVelocity);

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -55,8 +55,9 @@
2,
2,
],"resourceVersion":"1.0","name":"FAudioGMS_SetListenerPosition","tags":[],"resourceType":"GMExtensionFunction",},
{"externalName":"FAudioGMS_StreamingSound_LoadOGG","kind":1,"help":"FAudioGMS_StreamingSound_LoadOGG(filePath)","hidden":false,"returnType":2,"argCount":0,"args":[
{"externalName":"FAudioGMS_StreamingSound_LoadOGG","kind":1,"help":"FAudioGMS_StreamingSound_LoadOGG(filePath, bufferSizeInBytes)","hidden":false,"returnType":2,"argCount":0,"args":[
1,
2,
],"resourceVersion":"1.0","name":"FAudioGMS_StreamingSound_LoadOGG","tags":[],"resourceType":"GMExtensionFunction",},
{"externalName":"FAudioGMS_SoundInstance_SetPan","kind":1,"help":"FAudioGMS_SoundInstance_SetPan(soundInstanceID, pan)","hidden":false,"returnType":2,"argCount":0,"args":[
2,
@ -176,6 +177,28 @@
2,
2,
],"resourceVersion":"1.0","name":"FAudioGMS_SoundInstance_QueueSoundInstance","tags":[],"resourceType":"GMExtensionFunction",},
{"externalName":"FAudioGMS_SoundInstance_QueueSyncPlay","kind":1,"help":"FAudioGMS_SoundInstance_QueueSyncPlay(soundInstanceID)","hidden":false,"returnType":2,"argCount":0,"args":[
2,
],"resourceVersion":"1.0","name":"FAudioGMS_SoundInstance_QueueSyncPlay","tags":[],"resourceType":"GMExtensionFunction",},
{"externalName":"FAudioGMS_SoundInstance_SyncPlay","kind":1,"help":"FAudioGMS_SoundInstance_SyncPlay()","hidden":false,"returnType":2,"argCount":0,"args":[],"resourceVersion":"1.0","name":"FAudioGMS_SoundInstance_SyncPlay","tags":[],"resourceType":"GMExtensionFunction",},
{"externalName":"FAudioGMS_SoundInstance_Set3DOrientation","kind":1,"help":"FAudioGMS_SoundInstance_Set3DOrientation(soundInstanceID, xFront, yFront, zFront, xTop, yTop, zTop)","hidden":false,"returnType":2,"argCount":0,"args":[
2,
2,
2,
2,
2,
2,
2,
],"resourceVersion":"1.0","name":"FAudioGMS_SoundInstance_Set3DOrientation","tags":[],"resourceType":"GMExtensionFunction",},
{"externalName":"FAudioGMS_SetListenerOrientation","kind":1,"help":"FAudioGMS_SetListenerOrientation(soundInstanceID, xFront, yFront, zFront, xTop, yTop, zTop)","hidden":false,"returnType":2,"argCount":0,"args":[
2,
2,
2,
2,
2,
2,
2,
],"resourceVersion":"1.0","name":"FAudioGMS_SetListenerOrientation","tags":[],"resourceType":"GMExtensionFunction",},
],"constants":[],"ProxyFiles":[
{"TargetMask":7,"resourceVersion":"1.0","name":"libFAudioGMS.so","tags":[],"resourceType":"GMProxyFile",},
{"TargetMask":3,"resourceVersion":"1.0","name":"FAudioGMSAndroidDummy.ext","tags":[],"resourceType":"GMProxyFile",},
@ -189,12 +212,15 @@
{"name":"FAudioGMS_SoundInstance_Play","path":"extensions/FAudioGMS/FAudioGMS.yy",},
{"name":"FAudioGMS_SoundInstance_Pause","path":"extensions/FAudioGMS/FAudioGMS.yy",},
{"name":"FAudioGMS_SoundInstance_Stop","path":"extensions/FAudioGMS/FAudioGMS.yy",},
{"name":"FAudioGMS_SoundInstance_QueueSyncPlay","path":"extensions/FAudioGMS/FAudioGMS.yy",},
{"name":"FAudioGMS_SoundInstance_SyncPlay","path":"extensions/FAudioGMS/FAudioGMS.yy",},
{"name":"FAudioGMS_SoundInstance_SetLoop","path":"extensions/FAudioGMS/FAudioGMS.yy",},
{"name":"FAudioGMS_SoundInstance_SetPan","path":"extensions/FAudioGMS/FAudioGMS.yy",},
{"name":"FAudioGMS_SoundInstance_SetPitch","path":"extensions/FAudioGMS/FAudioGMS.yy",},
{"name":"FAudioGMS_SoundInstance_SetVolume","path":"extensions/FAudioGMS/FAudioGMS.yy",},
{"name":"FAudioGMS_SoundInstance_Set3DPosition","path":"extensions/FAudioGMS/FAudioGMS.yy",},
{"name":"FAudioGMS_SoundInstance_Set3DVelocity","path":"extensions/FAudioGMS/FAudioGMS.yy",},
{"name":"FAudioGMS_SoundInstance_Set3DOrientation","path":"extensions/FAudioGMS/FAudioGMS.yy",},
{"name":"FAudioGMS_SoundInstance_SetTrackPositionInSeconds","path":"extensions/FAudioGMS/FAudioGMS.yy",},
{"name":"FAudioGMS_SoundInstance_SetPlayRegion","path":"extensions/FAudioGMS/FAudioGMS.yy",},
{"name":"FAudioGMS_SoundInstance_SetVolumeOverTime","path":"extensions/FAudioGMS/FAudioGMS.yy",},
@ -218,6 +244,7 @@
{"name":"FAudioGMS_SetMasteringEffectGain","path":"extensions/FAudioGMS/FAudioGMS.yy",},
{"name":"FAudioGMS_SetListenerPosition","path":"extensions/FAudioGMS/FAudioGMS.yy",},
{"name":"FAudioGMS_SetListenerVelocity","path":"extensions/FAudioGMS/FAudioGMS.yy",},
{"name":"FAudioGMS_SetListenerOrientation","path":"extensions/FAudioGMS/FAudioGMS.yy",},
{"name":"FAudioGMS_ResumeAll","path":"extensions/FAudioGMS/FAudioGMS.yy",},
{"name":"FAudioGMS_PauseAll","path":"extensions/FAudioGMS/FAudioGMS.yy",},
{"name":"FAudioGMS_StopAll","path":"extensions/FAudioGMS/FAudioGMS.yy",},

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -36,47 +36,91 @@
#endif
#ifdef __cplusplus
extern "C" {
extern "C"
{
#endif /* __cplusplus */
FAUDIOGMSAPI void FAudioGMS_Init(double spatialDistanceScale, double timestep);
FAUDIOGMSAPI void FAudioGMS_Init(double spatialDistanceScale, double timestep);
FAUDIOGMSAPI double FAudioGMS_StaticSound_LoadWAV(char *filePath); /* returns a static sound ID */
FAUDIOGMSAPI double FAudioGMS_StaticSound_CreateSoundInstance(double staticSoundID); /* returns a sound instance ID */
FAUDIOGMSAPI void FAudioGMS_StaticSound_Destroy(double staticSoundID);
FAUDIOGMSAPI double FAudioGMS_StaticSound_LoadWAV(
char *filePath); /* returns a static sound ID */
FAUDIOGMSAPI double FAudioGMS_StaticSound_CreateSoundInstance(
double staticSoundID); /* returns a sound instance ID */
FAUDIOGMSAPI void FAudioGMS_StaticSound_Destroy(double staticSoundID);
FAUDIOGMSAPI double FAudioGMS_StreamingSound_LoadOGG(char* filepath); /* returns a sound instance ID */
/* returns a sound instance ID */
FAUDIOGMSAPI double FAudioGMS_StreamingSound_LoadOGG(
char *filepath,
double bufferSizeInBytes); /* if 0 is passed we will use a sensible default*/
FAUDIOGMSAPI void FAudioGMS_SoundInstance_Play(double soundInstanceID);
FAUDIOGMSAPI void FAudioGMS_SoundInstance_Pause(double soundInstanceID);
FAUDIOGMSAPI void FAudioGMS_SoundInstance_Stop(double soundInstanceID);
FAUDIOGMSAPI void FAudioGMS_SoundInstance_Play(double soundInstanceID);
FAUDIOGMSAPI void FAudioGMS_SoundInstance_Pause(double soundInstanceID);
FAUDIOGMSAPI void FAudioGMS_SoundInstance_Stop(double soundInstanceID);
FAUDIOGMSAPI void FAudioGMS_SoundInstance_SetPlayRegion(double soundInstanceID, double startInMilliseconds, double endInMilliseconds);
FAUDIOGMSAPI void FAudioGMS_SoundInstance_SetLoop(double soundInstanceID, double loop);
FAUDIOGMSAPI void FAudioGMS_SoundInstance_SetPan(double soundInstanceID, double pan);
FAUDIOGMSAPI void FAudioGMS_SoundInstance_SetPitch(double soundInstanceID, double pitch);
FAUDIOGMSAPI void FAudioGMS_SoundInstance_SetVolume(double soundInstanceID, double volume);
FAUDIOGMSAPI void FAudioGMS_SoundInstance_Set3DPosition(double soundInstanceID, double x, double y, double z);
FAUDIOGMSAPI void FAudioGMS_SoundInstance_Set3DVelocity(double soundInstanceID, double xVelocity, double yVelocity, double zVelocity);
FAUDIOGMSAPI void FAudioGMS_SoundInstance_SetTrackPositionInSeconds(double soundInstanceID, double trackPositionInSeconds);
FAUDIOGMSAPI void FAudioGMS_SoundInstance_SetVolumeOverTime(double soundInstanceID, double volume, double milliseconds);
FAUDIOGMSAPI void FAudioGMS_SoundInstance_SetLowPassFilter(double soundInstanceID, double lowPassFilter, double Q);
FAUDIOGMSAPI void FAudioGMS_SoundInstance_SetHighPassFilter(double soundInstanceID, double highPassFilter, double Q);
FAUDIOGMSAPI void FAudioGMS_SoundInstance_SetBandPassFilter(double soundInstanceID, double bandPassFilter, double Q);
FAUDIOGMSAPI void FAudioGMS_SoundInstance_QueueSyncPlay(double soundInstanceID);
FAUDIOGMSAPI void FAudioGMS_SoundInstance_SyncPlay();
FAUDIOGMSAPI void FAudioGMS_SoundInstance_QueueSoundInstance(double soundInstanceID, double queueSoundInstanceID);
FAUDIOGMSAPI void FAudioGMS_SoundInstance_SetPlayRegion(
double soundInstanceID,
double startInMilliseconds,
double endInMilliseconds);
FAUDIOGMSAPI void FAudioGMS_SoundInstance_SetLoop(double soundInstanceID, double loop);
FAUDIOGMSAPI void FAudioGMS_SoundInstance_SetPan(double soundInstanceID, double pan);
FAUDIOGMSAPI void FAudioGMS_SoundInstance_SetPitch(double soundInstanceID, double pitch);
FAUDIOGMSAPI void FAudioGMS_SoundInstance_SetVolume(double soundInstanceID, double volume);
FAUDIOGMSAPI void FAudioGMS_SoundInstance_Set3DPosition(
double soundInstanceID,
double x,
double y,
double z);
FAUDIOGMSAPI void FAudioGMS_SoundInstance_Set3DVelocity(
double soundInstanceID,
double xVelocity,
double yVelocity,
double zVelocity);
FAUDIOGMSAPI void FAudioGMS_SoundInstance_Set3DOrientation(
double soundInstanceID,
double xFront,
double yFront,
double zFront,
double xTop,
double yTop,
double zTop);
FAUDIOGMSAPI void FAudioGMS_SoundInstance_SetTrackPositionInSeconds(
double soundInstanceID,
double trackPositionInSeconds);
FAUDIOGMSAPI void FAudioGMS_SoundInstance_SetVolumeOverTime(
double soundInstanceID,
double volume,
double milliseconds);
FAUDIOGMSAPI void FAudioGMS_SoundInstance_SetLowPassFilter(
double soundInstanceID,
double lowPassFilter,
double Q);
FAUDIOGMSAPI void FAudioGMS_SoundInstance_SetHighPassFilter(
double soundInstanceID,
double highPassFilter,
double Q);
FAUDIOGMSAPI void FAudioGMS_SoundInstance_SetBandPassFilter(
double soundInstanceID,
double bandPassFilter,
double Q);
FAUDIOGMSAPI double FAudioGMS_SoundInstance_GetPitch(double soundInstanceID);
FAUDIOGMSAPI double FAudioGMS_SoundInstance_GetVolume(double soundInstanceID);
FAUDIOGMSAPI double FAudioGMS_SoundInstance_GetTrackLengthInSeconds(double soundInstanceID);
FAUDIOGMSAPI double FAudioGMS_SoundInstance_GetTrackPositionInSeconds(double soundInstanceID);
FAUDIOGMSAPI void FAudioGMS_SoundInstance_QueueSoundInstance(
double soundInstanceID,
double queueSoundInstanceID);
FAUDIOGMSAPI void FAudioGMS_SoundInstance_Destroy(double soundInstanceID);
FAUDIOGMSAPI void FAudioGMS_SoundInstance_DestroyWhenFinished(double soundInstanceID);
FAUDIOGMSAPI double FAudioGMS_SoundInstance_GetPitch(double soundInstanceID);
FAUDIOGMSAPI double FAudioGMS_SoundInstance_GetVolume(double soundInstanceID);
FAUDIOGMSAPI double FAudioGMS_SoundInstance_GetTrackLengthInSeconds(double soundInstanceID);
FAUDIOGMSAPI double FAudioGMS_SoundInstance_GetTrackPositionInSeconds(double soundInstanceID);
FAUDIOGMSAPI double FAudioGMS_EffectChain_Create();
FAUDIOGMSAPI void FAudioGMS_EffectChain_AddDefaultReverb(double effectChainID);
FAUDIOGMSAPI void FAudioGMS_EffectChain_AddReverb(
FAUDIOGMSAPI void FAudioGMS_SoundInstance_Destroy(double soundInstanceID);
FAUDIOGMSAPI void FAudioGMS_SoundInstance_DestroyWhenFinished(double soundInstanceID);
FAUDIOGMSAPI double FAudioGMS_EffectChain_Create();
FAUDIOGMSAPI void FAudioGMS_EffectChain_AddDefaultReverb(double effectChainID);
FAUDIOGMSAPI void FAudioGMS_EffectChain_AddReverb(
double effectChainID,
double wetDryMix,
double reflectionsDelay,
@ -91,29 +135,46 @@ FAUDIOGMSAPI void FAudioGMS_EffectChain_AddReverb(
double reverbGain,
double decayTime,
double density,
double roomSize
);
FAUDIOGMSAPI void FAudioGMS_EffectChain_Destroy(double effectChainID);
double roomSize);
FAUDIOGMSAPI void FAudioGMS_EffectChain_Destroy(double effectChainID);
/*
/*
* NOTE: Any changes to the effect chain will NOT apply after this is set!
* You MUST call SetEffectChain again if you make changes to the effect chain parameters!
* You MUST call SetEffectChain again if you make changes to the effect
* chain parameters!
*/
FAUDIOGMSAPI void FAudioGMS_SoundInstance_SetEffectChain(double soundInstanceID, double effectChainID, double effectGain);
FAUDIOGMSAPI void FAudioGMS_SoundInstance_SetEffectGain(double soundInstanceID, double effectGain);
FAUDIOGMSAPI void FAudioGMS_SoundInstance_SetEffectChain(
double soundInstanceID,
double effectChainID,
double effectGain);
FAUDIOGMSAPI void FAudioGMS_SoundInstance_SetEffectGain(
double soundInstanceID,
double effectGain);
FAUDIOGMSAPI void FAudioGMS_SetMasteringEffectChain(double effectChainID, double effectGain);
FAUDIOGMSAPI void FAudioGMS_SetMasteringEffectGain(double effectGain);
FAUDIOGMSAPI void FAudioGMS_SetMasteringEffectChain(double effectChainID, double effectGain);
FAUDIOGMSAPI void FAudioGMS_SetMasteringEffectGain(double effectGain);
FAUDIOGMSAPI void FAudioGMS_SetListenerPosition(double x, double y, double z);
FAUDIOGMSAPI void FAudioGMS_SetListenerVelocity(double xVelocity, double yVelocity, double zVelocity);
FAUDIOGMSAPI void FAudioGMS_SetListenerPosition(double x, double y, double z);
FAUDIOGMSAPI void FAudioGMS_SetListenerVelocity(
double xVelocity,
double yVelocity,
double zVelocity);
FAUDIOGMSAPI void FAudioGMS_SetListenerOrientation(
double soundInstanceID,
double xFront,
double yFront,
double zFront,
double xTop,
double yTop,
double zTop);
FAUDIOGMSAPI void FAudioGMS_PauseAll(); /* useful for mobile platforms, etc */
FAUDIOGMSAPI void FAudioGMS_ResumeAll(); /* same as above */
FAUDIOGMSAPI void FAudioGMS_StopAll();
FAUDIOGMSAPI void FAudioGMS_PauseAll(); /* useful for mobile platforms, etc
*/
FAUDIOGMSAPI void FAudioGMS_ResumeAll(); /* same as above */
FAUDIOGMSAPI void FAudioGMS_StopAll();
FAUDIOGMSAPI void FAudioGMS_Update();
FAUDIOGMSAPI void FAudioGMS_Destroy();
FAUDIOGMSAPI void FAudioGMS_Update();
FAUDIOGMSAPI void FAudioGMS_Destroy();
#ifdef __cplusplus
}

View File

@ -39,13 +39,14 @@
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<PlatformToolset>ClangCL</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<PlatformToolset>v142</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
@ -89,20 +90,23 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<FunctionLevelLinking>false</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<RuntimeLibrary Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Release|x64'">SetupAPI.lib;Version.lib;Winmm.lib;Imm32.lib;libucrt.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Release|x64'">libucrt.lib;SetupAPI.lib;Version.lib;Winmm.lib;Imm32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<ProjectReference>
<UseLibraryDependencyInputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</UseLibraryDependencyInputs>
</ProjectReference>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\src\FAudioGMS.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\lib\dr_wav.h" />
<ClInclude Include="..\src\FAudioGMS.h" />
</ItemGroup>
<ItemGroup>