├── jni
├── Application.mk
├── libfmod.so
├── libfmodL.so
├── Android.mk
├── org_fmod_example_Utils.h
├── supersound.cpp
└── inc
│ ├── fmod_output.h
│ ├── fmod_errors.h
│ ├── fmod_codec.h
│ ├── fmod.hpp
│ ├── fmod_dsp.h
│ └── fmod.h
├── assets
└── zph.wav
├── libs
├── fmod.jar
├── armeabi
│ ├── libfmod.so
│ ├── libfmodL.so
│ └── libsound.so
└── android-support-v4.jar
├── ic_launcher-web.png
├── obj
└── local
│ └── armeabi
│ ├── libfmod.so
│ ├── libfmodL.so
│ ├── libsound.so
│ └── objs
│ └── sound
│ ├── supersound.o
│ └── supersound.o.d
├── res
├── drawable-hdpi
│ ├── dashu.png
│ ├── gaoguai.png
│ ├── luoli.png
│ ├── record.png
│ ├── jingsong.png
│ ├── kongling.PNG
│ ├── btn_record.png
│ └── ic_launcher.png
├── drawable-mdpi
│ └── ic_launcher.png
├── drawable-xhdpi
│ └── ic_launcher.png
├── drawable-xxhdpi
│ └── ic_launcher.png
├── values
│ ├── dimens.xml
│ ├── strings.xml
│ └── styles.xml
├── values-v11
│ └── styles.xml
├── menu
│ └── main.xml
├── values-w820dp
│ └── dimens.xml
├── values-v14
│ └── styles.xml
└── layout
│ └── activity_main.xml
├── .gitattributes
├── .classpath
├── project.properties
├── src
└── org
│ └── fmod
│ └── example
│ ├── Utils.java
│ └── SoundActivity.java
├── proguard-project.txt
├── AndroidManifest.xml
├── .gitignore
├── .project
├── .cproject
└── README.md
/jni/Application.mk:
--------------------------------------------------------------------------------
1 | APP_STL := gnustl_static
--------------------------------------------------------------------------------
/assets/zph.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CN-ZPH/MySound/HEAD/assets/zph.wav
--------------------------------------------------------------------------------
/jni/libfmod.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CN-ZPH/MySound/HEAD/jni/libfmod.so
--------------------------------------------------------------------------------
/libs/fmod.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CN-ZPH/MySound/HEAD/libs/fmod.jar
--------------------------------------------------------------------------------
/jni/libfmodL.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CN-ZPH/MySound/HEAD/jni/libfmodL.so
--------------------------------------------------------------------------------
/ic_launcher-web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CN-ZPH/MySound/HEAD/ic_launcher-web.png
--------------------------------------------------------------------------------
/libs/armeabi/libfmod.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CN-ZPH/MySound/HEAD/libs/armeabi/libfmod.so
--------------------------------------------------------------------------------
/libs/armeabi/libfmodL.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CN-ZPH/MySound/HEAD/libs/armeabi/libfmodL.so
--------------------------------------------------------------------------------
/libs/armeabi/libsound.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CN-ZPH/MySound/HEAD/libs/armeabi/libsound.so
--------------------------------------------------------------------------------
/libs/android-support-v4.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CN-ZPH/MySound/HEAD/libs/android-support-v4.jar
--------------------------------------------------------------------------------
/obj/local/armeabi/libfmod.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CN-ZPH/MySound/HEAD/obj/local/armeabi/libfmod.so
--------------------------------------------------------------------------------
/obj/local/armeabi/libfmodL.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CN-ZPH/MySound/HEAD/obj/local/armeabi/libfmodL.so
--------------------------------------------------------------------------------
/obj/local/armeabi/libsound.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CN-ZPH/MySound/HEAD/obj/local/armeabi/libsound.so
--------------------------------------------------------------------------------
/res/drawable-hdpi/dashu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CN-ZPH/MySound/HEAD/res/drawable-hdpi/dashu.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/gaoguai.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CN-ZPH/MySound/HEAD/res/drawable-hdpi/gaoguai.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/luoli.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CN-ZPH/MySound/HEAD/res/drawable-hdpi/luoli.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/record.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CN-ZPH/MySound/HEAD/res/drawable-hdpi/record.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/jingsong.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CN-ZPH/MySound/HEAD/res/drawable-hdpi/jingsong.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/kongling.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CN-ZPH/MySound/HEAD/res/drawable-hdpi/kongling.PNG
--------------------------------------------------------------------------------
/res/drawable-hdpi/btn_record.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CN-ZPH/MySound/HEAD/res/drawable-hdpi/btn_record.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CN-ZPH/MySound/HEAD/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CN-ZPH/MySound/HEAD/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CN-ZPH/MySound/HEAD/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CN-ZPH/MySound/HEAD/res/drawable-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/obj/local/armeabi/objs/sound/supersound.o:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CN-ZPH/MySound/HEAD/obj/local/armeabi/objs/sound/supersound.o
--------------------------------------------------------------------------------
/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 16dp
5 | 16dp
6 |
7 |
8 |
--------------------------------------------------------------------------------
/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | MySound
5 | Hello world!
6 | Settings
7 |
8 |
9 |
--------------------------------------------------------------------------------
/res/values-v11/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/res/menu/main.xml:
--------------------------------------------------------------------------------
1 |
12 |
--------------------------------------------------------------------------------
/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 | 64dp
9 |
10 |
11 |
--------------------------------------------------------------------------------
/res/values-v14/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | # Custom for Visual Studio
5 | *.cs diff=csharp
6 |
7 | # Standard to msysgit
8 | *.doc diff=astextplain
9 | *.DOC diff=astextplain
10 | *.docx diff=astextplain
11 | *.DOCX diff=astextplain
12 | *.dot diff=astextplain
13 | *.DOT diff=astextplain
14 | *.pdf diff=astextplain
15 | *.PDF diff=astextplain
16 | *.rtf diff=astextplain
17 | *.RTF diff=astextplain
18 |
--------------------------------------------------------------------------------
/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/jni/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 |
4 | include $(CLEAR_VARS)
5 | LOCAL_MODULE := fmod
6 | LOCAL_SRC_FILES := libfmod.so
7 | include $(PREBUILT_SHARED_LIBRARY)
8 |
9 | include $(CLEAR_VARS)
10 | LOCAL_MODULE := fmodL
11 | LOCAL_SRC_FILES := libfmodL.so
12 | include $(PREBUILT_SHARED_LIBRARY)
13 |
14 | include $(CLEAR_VARS)
15 |
16 | LOCAL_MODULE := sound
17 | LOCAL_SRC_FILES := supersound.cpp
18 | LOCAL_SHARED_LIBRARIES := fmod fmodL
19 | LOCAL_LDLIBS := -llog
20 | LOCAL_CPP_FEATURES :=exceptions
21 | include $(BUILD_SHARED_LIBRARY)
22 |
--------------------------------------------------------------------------------
/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system edit
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 |
13 | # Project target.
14 | target=android-23
15 |
--------------------------------------------------------------------------------
/src/org/fmod/example/Utils.java:
--------------------------------------------------------------------------------
1 | package org.fmod.example;
2 | /**
3 | * Created by 張鵬輝 on 2017/2/1.
4 | * Email: 1344670918@qq.com
5 | */
6 | public class Utils {
7 | //音效类型
8 | public static final int MODE_NORMAL=0;
9 | public static final int MODE_LUOLI=1;
10 | public static final int MODE_DASHU=2;
11 | public static final int MODE_JINGSONG=3;
12 | public static final int MODE_GAOGUAI=4;
13 | public static final int MODE_KONGLING=5;
14 | /**
15 | * 音效处理传2个值
16 | * @param path 音频文件路径
17 | * @param type 音频文件类型
18 | */
19 | public native static void fix(String path,int type);
20 | static{
21 | System.loadLibrary("fmodL");
22 | System.loadLibrary("fmod");
23 | System.loadLibrary("sound");
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/proguard-project.txt:
--------------------------------------------------------------------------------
1 | # To enable ProGuard in your project, edit project.properties
2 | # to define the proguard.config property as described in that file.
3 | #
4 | # Add project specific ProGuard rules here.
5 | # By default, the flags in this file are appended to flags specified
6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt
7 | # You can edit the include path and order by changing the ProGuard
8 | # include property in project.properties.
9 | #
10 | # For more details, see
11 | # http://developer.android.com/guide/developing/tools/proguard.html
12 |
13 | # Add any project specific keep options here:
14 |
15 | # If your project uses WebView with JS, uncomment the following
16 | # and specify the fully qualified class name to the JavaScript interface
17 | # class:
18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19 | # public *;
20 | #}
21 |
--------------------------------------------------------------------------------
/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
10 |
11 |
12 |
17 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/jni/org_fmod_example_Utils.h:
--------------------------------------------------------------------------------
1 | /* DO NOT EDIT THIS FILE - it is machine generated */
2 | #include
3 | /* Header for class org_fmod_example_Utils */
4 |
5 | #ifndef _Included_org_fmod_example_Utils
6 | #define _Included_org_fmod_example_Utils
7 | #ifdef __cplusplus
8 | extern "C" {
9 | #endif
10 | #undef org_fmod_example_Utils_MODE_NORMAL
11 | #define org_fmod_example_Utils_MODE_NORMAL 0L
12 | #undef org_fmod_example_Utils_MODE_LUOLI
13 | #define org_fmod_example_Utils_MODE_LUOLI 1L
14 | #undef org_fmod_example_Utils_MODE_DASHU
15 | #define org_fmod_example_Utils_MODE_DASHU 2L
16 | #undef org_fmod_example_Utils_MODE_JINGSONG
17 | #define org_fmod_example_Utils_MODE_JINGSONG 3L
18 | #undef org_fmod_example_Utils_MODE_GAOGUAI
19 | #define org_fmod_example_Utils_MODE_GAOGUAI 4L
20 | #undef org_fmod_example_Utils_MODE_KONGLING
21 | #define org_fmod_example_Utils_MODE_KONGLING 5L
22 | /*
23 | * Class: org_fmod_example_Utils
24 | * Method: fix
25 | * Signature: (Ljava/lang/String;I)V
26 | */
27 | JNIEXPORT void JNICALL Java_org_fmod_example_Utils_fix
28 | (JNIEnv *, jclass, jstring, jint);
29 |
30 | #ifdef __cplusplus
31 | }
32 | #endif
33 | #endif
34 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Built application files
2 | *.apk
3 | *.ap_
4 |
5 | # Files for the Dalvik VM
6 | *.dex
7 |
8 | # Java class files
9 | *.class
10 |
11 | # Generated files
12 | bin/
13 | gen/
14 |
15 | # Gradle files
16 | .gradle/
17 | build/
18 |
19 | # Local configuration file (sdk path, etc)
20 | local.properties
21 |
22 | # Proguard folder generated by Eclipse
23 | proguard/
24 |
25 | # Log Files
26 | *.log
27 |
28 | # =========================
29 | # Operating System Files
30 | # =========================
31 |
32 | # OSX
33 | # =========================
34 |
35 | .DS_Store
36 | .AppleDouble
37 | .LSOverride
38 |
39 | # Thumbnails
40 | ._*
41 |
42 | # Files that might appear on external disk
43 | .Spotlight-V100
44 | .Trashes
45 |
46 | # Directories potentially created on remote AFP share
47 | .AppleDB
48 | .AppleDesktop
49 | Network Trash Folder
50 | Temporary Items
51 | .apdisk
52 |
53 | # Windows
54 | # =========================
55 |
56 | # Windows image file caches
57 | Thumbs.db
58 | ehthumbs.db
59 |
60 | # Folder config file
61 | Desktop.ini
62 |
63 | # Recycle Bin used on file shares
64 | $RECYCLE.BIN/
65 |
66 | # Windows Installer files
67 | *.cab
68 | *.msi
69 | *.msm
70 | *.msp
71 |
72 | # Windows shortcuts
73 | *.lnk
74 |
--------------------------------------------------------------------------------
/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
14 |
15 |
16 |
19 |
25 |
26 |
32 |
33 |
--------------------------------------------------------------------------------
/src/org/fmod/example/SoundActivity.java:
--------------------------------------------------------------------------------
1 | package org.fmod.example;
2 |
3 | import java.io.File;
4 | import java.io.InputStream;
5 |
6 | import org.fmod.FMOD;
7 |
8 | import com.zph.mysound.R;
9 |
10 | import android.app.Activity;
11 | import android.os.Bundle;
12 | import android.os.Environment;
13 | import android.view.View;
14 | import android.widget.Toast;
15 | /**
16 | * Created by 張鵬輝 on 2017/2/1.
17 | * Email: 1344670918@qq.com
18 | */
19 |
20 | public class SoundActivity extends Activity{
21 | @Override
22 | protected void onCreate(Bundle savedInstanceState) {
23 | // TODO Auto-generated method stub
24 | super.onCreate(savedInstanceState);
25 | FMOD.init(this);
26 | setContentView(R.layout.activity_main);
27 | }
28 | public void mFix(View v) {
29 | //音频路径可以去获取麦克风的数据,我这里写死了
30 | String path = "file:///android_asset/zph.wav";
31 | switch (v.getId()) {
32 | case R.id.btn_normal:
33 | Utils.fix(path, Utils.MODE_NORMAL);
34 | break;
35 | case R.id.btn_luoli:
36 | Utils.fix(path, Utils.MODE_LUOLI);
37 | break;
38 | case R.id.btn_dashu:
39 | Utils.fix(path, Utils.MODE_DASHU);
40 | break;
41 | case R.id.btn_jingsong:
42 | Utils.fix(path, Utils.MODE_JINGSONG);
43 | break;
44 | case R.id.btn_gaoguai:
45 | Utils.fix(path, Utils.MODE_GAOGUAI);
46 | break;
47 | case R.id.btn_kongling:
48 | Utils.fix(path, Utils.MODE_KONGLING);
49 | break;
50 | default:
51 | break;
52 | }
53 | }
54 |
55 | @Override
56 | protected void onDestroy() {
57 | // TODO Auto-generated method stub
58 | super.onDestroy();
59 | FMOD.close();
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/jni/supersound.cpp:
--------------------------------------------------------------------------------
1 | #include "inc/fmod.hpp"
2 | #include
3 | #include
4 | #include "org_fmod_example_Utils.h"
5 |
6 | #include
7 | #define LOGI(FORMAT,...) __android_log_print(ANDROID_LOG_INFO,"zph",FORMAT,##__VA_ARGS__);
8 | #define LOGE(FORMAT,...) __android_log_print(ANDROID_LOG_ERROR,"zph",FORMAT,##__VA_ARGS__);
9 |
10 | #define MODE_NORMAL 0
11 | #define MODE_LUOLI 1
12 | #define MODE_DASHU 2
13 | #define MODE_JINGSONG 3
14 | #define MODE_GAOGUAI 4
15 | #define MODE_KONGLING 5
16 | using namespace FMOD;
17 |
18 | JNIEXPORT void JNICALL Java_org_fmod_example_Utils_fix(JNIEnv *env,
19 | jclass jcls, jstring path_jstr, jint type) {
20 | //初始化
21 | System *system;
22 | Sound *sound;
23 | DSP *dsp;
24 | bool playing = true;
25 | Channel *channel;
26 | float frequency = 0;
27 | System_Create(&system);
28 | system->init(32, FMOD_INIT_NORMAL, NULL);
29 | const char* path_cstr = env->GetStringUTFChars(path_jstr, NULL);
30 | try {
31 |
32 | //创建声音
33 | system->createSound(path_cstr, FMOD_DEFAULT, NULL, &sound);
34 | switch (type) {
35 | case MODE_NORMAL:
36 | //原生播放
37 | LOGI("%s", path_cstr);
38 | system->playSound(sound, 0, false, &channel);
39 | LOGI("%s", "fix normal");
40 | break;
41 | case MODE_LUOLI:
42 | //loli
43 | //DSP digital singal process
44 | //dsp->音效
45 | //dsp 提升或者降低音调的一种音效
46 | system->createDSPByType(FMOD_DSP_TYPE_PITCHSHIFT, &dsp);
47 | //设置音调的参数
48 | dsp->setParameterFloat(FMOD_DSP_PITCHSHIFT_PITCH, 8.0);
49 | //添加进到channel
50 | system->playSound(sound, 0, false, &channel);
51 | channel->addDSP(0, dsp);
52 | break;
53 | case MODE_DASHU:
54 | //大叔
55 | system->createDSPByType(FMOD_DSP_TYPE_PITCHSHIFT, &dsp);
56 | //设置音调的参数
57 | dsp->setParameterFloat(FMOD_DSP_PITCHSHIFT_PITCH, 0.8);
58 | //添加进到channel
59 | system->playSound(sound, 0, false, &channel);
60 | channel->addDSP(0, dsp);
61 | break;
62 | case MODE_JINGSONG:
63 | //惊悚
64 | system->createDSPByType(FMOD_DSP_TYPE_TREMOLO, &dsp);
65 | dsp->setParameterFloat(FMOD_DSP_TREMOLO_SKEW, 5);
66 | system->playSound(sound, 0, false, &channel);
67 | channel->addDSP(0, dsp);
68 | break;
69 | case MODE_GAOGUAI:
70 | //搞怪
71 | //提高说话的速度
72 | system->playSound(sound, 0, false, &channel);
73 | channel->getFrequency(&frequency);
74 | frequency = frequency * 2;
75 | channel->setFrequency(frequency);
76 | break;
77 | case MODE_KONGLING:
78 | //空灵
79 | system->createDSPByType(FMOD_DSP_TYPE_ECHO, &dsp);
80 | dsp->setParameterFloat(FMOD_DSP_ECHO_DELAY, 300);
81 | dsp->setParameterFloat(FMOD_DSP_ECHO_FEEDBACK, 20);
82 | system->playSound(sound, 0, false, &channel);
83 | channel->addDSP(0, dsp);
84 | break;
85 | default:
86 | break;
87 | }
88 | } catch (...) {
89 | LOGE("%s", "发生异常");
90 | goto end;
91 | }
92 | system->update();
93 | //释放资源
94 | //单位是微妙
95 | //每秒钟判断下是否是播放
96 | while (playing) {
97 | channel->isPlaying(&playing);
98 | usleep(1000 * 1000);
99 | }
100 | goto end;
101 | end: env->ReleaseStringUTFChars(path_jstr, path_cstr);
102 | sound->release();
103 | system->close();
104 | system->release();
105 | }
106 |
--------------------------------------------------------------------------------
/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | MySound
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.cdt.managedbuilder.core.genmakebuilder
10 | clean,full,incremental,
11 |
12 |
13 | ?children?
14 | ?children?=?name?=entry\\\\\\\|\\\|?name?=entry\\\\\\\|\\\|\|?name?=outputEntries\||
15 |
16 |
17 | ?name?
18 |
19 |
20 |
21 | org.eclipse.cdt.make.core.append_environment
22 | true
23 |
24 |
25 | org.eclipse.cdt.make.core.buildArguments
26 |
27 |
28 |
29 | org.eclipse.cdt.make.core.buildCommand
30 | ndk-build
31 |
32 |
33 | org.eclipse.cdt.make.core.cleanBuildTarget
34 | clean
35 |
36 |
37 | org.eclipse.cdt.make.core.contents
38 | org.eclipse.cdt.make.core.activeConfigSettings
39 |
40 |
41 | org.eclipse.cdt.make.core.enableAutoBuild
42 | false
43 |
44 |
45 | org.eclipse.cdt.make.core.enableCleanBuild
46 | true
47 |
48 |
49 | org.eclipse.cdt.make.core.enableFullBuild
50 | true
51 |
52 |
53 | org.eclipse.cdt.make.core.stopOnError
54 | true
55 |
56 |
57 | org.eclipse.cdt.make.core.useDefaultBuildCmd
58 | true
59 |
60 |
61 |
62 |
63 | com.android.ide.eclipse.adt.ResourceManagerBuilder
64 |
65 |
66 |
67 |
68 | com.android.ide.eclipse.adt.PreCompilerBuilder
69 |
70 |
71 |
72 |
73 | org.eclipse.jdt.core.javabuilder
74 |
75 |
76 |
77 |
78 | com.android.ide.eclipse.adt.ApkBuilder
79 |
80 |
81 |
82 |
83 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
84 | full,incremental,
85 |
86 |
87 |
88 |
89 |
90 | com.android.ide.eclipse.adt.AndroidNature
91 | org.eclipse.jdt.core.javanature
92 | org.eclipse.cdt.core.cnature
93 | org.eclipse.cdt.core.ccnature
94 | org.eclipse.cdt.managedbuilder.core.managedBuildNature
95 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature
96 |
97 |
98 |
--------------------------------------------------------------------------------
/.cproject:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
13 |
14 |
19 |
20 |
24 |
29 |
32 |
33 |
34 |
38 |
43 |
46 |
47 |
48 |
49 |
53 |
58 |
61 |
62 |
63 |
64 |
69 |
70 |
74 |
79 |
82 |
83 |
84 |
88 |
93 |
96 |
97 |
98 |
102 |
107 |
110 |
111 |
112 |
113 |
114 |
115 |
--------------------------------------------------------------------------------
/obj/local/armeabi/objs/sound/supersound.o.d:
--------------------------------------------------------------------------------
1 | obj/local/armeabi/objs/sound/supersound.o: jni/supersound.cpp \
2 | jni/inc/fmod.hpp jni/inc/fmod_common.h jni/inc/fmod_codec.h \
3 | jni/inc/fmod_dsp.h jni/inc/fmod_dsp_effects.h jni/inc/fmod_output.h \
4 | jni/inc/fmod.h \
5 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/stdlib.h \
6 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/sys/cdefs.h \
7 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/sys/cdefs_elf.h \
8 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/android/api-level.h \
9 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/string.h \
10 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/malloc.h \
11 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/alloca.h \
12 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/strings.h \
13 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/sys/types.h \
14 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/stdint.h \
15 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/sys/_types.h \
16 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/machine/_types.h \
17 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/linux/posix_types.h \
18 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/linux/stddef.h \
19 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/linux/compiler.h \
20 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/asm/posix_types.h \
21 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/asm/types.h \
22 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/linux/types.h \
23 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/machine/kernel.h \
24 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/sys/sysmacros.h \
25 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/memory.h \
26 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/unistd.h \
27 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/sys/select.h \
28 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/sys/time.h \
29 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/linux/time.h \
30 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/signal.h \
31 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/limits.h \
32 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/sys/limits.h \
33 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/linux/limits.h \
34 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/machine/internal_types.h \
35 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/machine/limits.h \
36 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/sys/syslimits.h \
37 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/asm/page.h \
38 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/asm/signal.h \
39 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/asm-generic/signal.h \
40 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/asm/sigcontext.h \
41 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/asm/siginfo.h \
42 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/asm-generic/siginfo.h \
43 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/sys/sysconf.h \
44 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/linux/capability.h \
45 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/pathconf.h \
46 | jni/org_fmod_example_Utils.h \
47 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/jni.h \
48 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/android/log.h
49 |
50 | jni/inc/fmod.hpp:
51 |
52 | jni/inc/fmod_common.h:
53 |
54 | jni/inc/fmod_codec.h:
55 |
56 | jni/inc/fmod_dsp.h:
57 |
58 | jni/inc/fmod_dsp_effects.h:
59 |
60 | jni/inc/fmod_output.h:
61 |
62 | jni/inc/fmod.h:
63 |
64 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/stdlib.h:
65 |
66 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/sys/cdefs.h:
67 |
68 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/sys/cdefs_elf.h:
69 |
70 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/android/api-level.h:
71 |
72 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/string.h:
73 |
74 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/malloc.h:
75 |
76 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/alloca.h:
77 |
78 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/strings.h:
79 |
80 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/sys/types.h:
81 |
82 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/stdint.h:
83 |
84 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/sys/_types.h:
85 |
86 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/machine/_types.h:
87 |
88 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/linux/posix_types.h:
89 |
90 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/linux/stddef.h:
91 |
92 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/linux/compiler.h:
93 |
94 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/asm/posix_types.h:
95 |
96 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/asm/types.h:
97 |
98 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/linux/types.h:
99 |
100 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/machine/kernel.h:
101 |
102 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/sys/sysmacros.h:
103 |
104 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/memory.h:
105 |
106 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/unistd.h:
107 |
108 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/sys/select.h:
109 |
110 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/sys/time.h:
111 |
112 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/linux/time.h:
113 |
114 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/signal.h:
115 |
116 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/limits.h:
117 |
118 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/sys/limits.h:
119 |
120 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/linux/limits.h:
121 |
122 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/machine/internal_types.h:
123 |
124 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/machine/limits.h:
125 |
126 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/sys/syslimits.h:
127 |
128 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/asm/page.h:
129 |
130 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/asm/signal.h:
131 |
132 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/asm-generic/signal.h:
133 |
134 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/asm/sigcontext.h:
135 |
136 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/asm/siginfo.h:
137 |
138 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/asm-generic/siginfo.h:
139 |
140 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/sys/sysconf.h:
141 |
142 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/linux/capability.h:
143 |
144 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/pathconf.h:
145 |
146 | jni/org_fmod_example_Utils.h:
147 |
148 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/jni.h:
149 |
150 | E:/android-ndk-r9d/platforms/android-19/arch-arm/usr/include/android/log.h:
151 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # MySound
2 | 仿QQ语音变声功能实现
3 | > 版权声明:转载必须注明本文转自张鹏辉的博客: http://blog.csdn.net/qingtiangg
4 |
5 | >大家好,这是我从业以来第一篇博客,给大家拜个晚年,祝大家鸡年大吉,幸福美满、事业有成。好了请容许我唠叨几万字。首先自我介绍下
6 | 我叫张鹏辉大家可以叫我道长,我是老司······哦不,我是新人请大家多多关照。 一直都是看别人的博客成长(复制、黏贴),总想自己写点什么,发出来,让大家去点评,给建议互相成长。这也是我的初衷,也就有了这个博客的诞生。。。在下目前从事移动开发所以目前以移动端内容来发布,记录一些日常开发中碰到的坑,和项目中一些模块拿出来开源互相学习(几万字略。。。我用意念给你们介绍完了,就当你们了解我了)
7 |
8 | 闲话不多说了开撸,如题今天请跟贫道一步步来实现球球语音变声功能
9 | ## 分析
10 | 首先我们来看下QQ语音变声效果,如下图所示:
11 |
12 | 
13 |
14 |
15 | 点击发送语音在点击相应的生效发出去就变声了,没玩过的可以打开QQ试下,那么他们是怎么做到让声音变声呢!看官们接着往下看。
16 |
17 | 首先我们知道,录制人声到手机,这些音频数据是由二进制十六进制组成,如果我们自己去用算法处理这些数据这个难度是比较大的。
18 |
19 | 那么怎么办???庆幸吧我们Android开发中有个NDK的东西,简单来说就是我们在java层调用c/c++的一些强大的开源库,(这里不讲NDK基础如果想了解请谷歌一下)。
20 |
21 | 网上有很多开源的音频处理库。我不知道腾讯是用的那个,但我们今天用到的是FMOD音频引擎,如果你做过游戏开发相信你一定接触过,这里附上FMOD官网链接大家可以去简单的看下介绍,国内FMOD的中文资料几乎没有,所以还是建议你去官网了解,[点我进fmod官网](http://www.fmod.org/),这里就不详细介绍了,他的主要功能就是对音频进行处理,比如你玩赛车类游戏你的引擎轰鸣声,会随着你的速度变化而变化,游戏中有多个视角,比如车内切换到车外,你听到的声音是不是不一样的,再比如我们当年玩的cs游戏,你附近的敌人在你不同角度开枪,你听到的声音也是不一样的,(!!!暴露年龄了。。。)
22 |
23 |
24 |
25 | 或许我们来个图更好理解:
26 |
27 | 
28 |
29 | >听到脚步声或枪声,就可以判断出敌人在你什么位置,不同的位置方位明显听到的声音不同
30 |
31 | ##开始
32 |
33 | 好的大体环境介绍完了,接下来我们看代码。
34 |
35 |
36 | 首先我们新建eclipse工程‘’mysound‘’(这里不要问我为什么不用Android Studio开发as现在多火啊!,因为ndk开发as还是有些问题的,有些坑我也没解决,我能怎么办?我也很绝望呀 。当然了以后我主要还是以as去写,如果今天的项目你能移植到as里面请联系我!)
37 |
38 | 首先我们导入一下FMOD的so动态库和一些需要用到的头文件。
39 |
40 | 
41 |
42 |
43 | >今天的所有代码和用到的库我都会放到github上,所以不用担心这些文件去哪找。
44 |
45 |
46 | ###1.接了下我们将工程转成C/C++工程 Add Native Support
47 |
48 | 
49 |
50 | 之后会给你生成android.mk文件 我们来配置一下里面的文件,引入提供的预编译的so库把他们放到jni目录下,还有他自己的函数的实现也要引入看下面
51 |
52 | ```
53 | LOCAL_PATH := $(call my-dir)
54 |
55 |
56 | include $(CLEAR_VARS)
57 | LOCAL_MODULE := fmod
58 | LOCAL_SRC_FILES := libfmod.so
59 | include $(PREBUILT_SHARED_LIBRARY)
60 |
61 | include $(CLEAR_VARS)
62 | LOCAL_MODULE := fmodL
63 | LOCAL_SRC_FILES := libfmodL.so
64 | include $(PREBUILT_SHARED_LIBRARY)
65 |
66 | include $(CLEAR_VARS)
67 |
68 | LOCAL_MODULE := sound
69 | LOCAL_SRC_FILES :=effect_fix.cpp
70 | LOCAL_SHARED_LIBRARIES := fmod fmodL
71 | LOCAL_LDLIBS := -llog
72 | LOCAL_CPP_FEATURES :=exceptions
73 | include $(BUILD_SHARED_LIBRARY)
74 |
75 | ```
76 | >LOCAL_MODULE := sound 自己的动态库名切记要和System.loadLibrary("sound");一致这坑我踩过 ,fmod fmodL这是2个预编译的库
77 | >如果你引入的是官网提供的库可能会出现一些路径的问题改一下就好我的已经改了。
78 |
79 | >划重点 FMOD 用到了标准模板库STL,说用这玩意会变慢?,但我没感觉出来
80 | >安卓ndk里面已经有了一个最小的c++运行库,想用那么我们就需要另外的配置
81 |
82 | 怎么配置呢?看ndk提供的文档 在我们下载的ndk目录里就有解决方法APP_STL
83 |
84 | 
85 |
86 | 
87 |
88 |
89 | ###2.创建Application.mk 支持C++异常处理,标准模板块
90 |
91 | 里面就一句话 :
92 | >APP_STL := gnustl_static
93 |
94 |
95 | 3.配置完我们来写java代码
96 |
97 | 布局我就不在这贴出来了几个按钮,看关键代码
98 |
99 | 我们先来个工具类Utils
100 |
101 | ```
102 | public class Utils {
103 | //音效类型 大叔萝莉什么的类型
104 | public static final int MODE_NORMAL=0;
105 | public static final int MODE_LUOLI=1;
106 | public static final int MODE_DASHU=2;
107 | public static final int MODE_JINGSONG=3;
108 | public static final int MODE_GAOGUAI=4;
109 | public static final int MODE_KONGLING=5;
110 | /**
111 | * 音效处理传2个值
112 | * @param path 音频文件路径
113 | * @param type 音频文件类型
114 | */
115 | public native static void fix(String path,int type);
116 | //加载动态库
117 | //要和你android.mk文件一致
118 | static{
119 | System.loadLibrary("fmodL");
120 | System.loadLibrary("fmod");
121 | System.loadLibrary("sound");
122 | }
123 | }
124 | ```
125 | ###接下来我们生成头文件
126 |
127 | 
128 |
129 | 然后到项目F5刷新一下src目录下会多出个.h的文件把它拖到jni目录下
130 | 继续在jni目录下创建一个c++源文件 supersound.cpp代码
131 |
132 | ```
133 | #include "inc/fmod.hpp"
134 | #include
135 | #include
136 | #include "org_fmod_example_Utils.h"
137 |
138 | #include
139 | #define LOGI(FORMAT,...) __android_log_print(ANDROID_LOG_INFO,"zph",FORMAT,##__VA_ARGS__);
140 | #define LOGE(FORMAT,...) __android_log_print(ANDROID_LOG_ERROR,"zph",FORMAT,##__VA_ARGS__);
141 |
142 | #define MODE_NORMAL 0
143 | #define MODE_LUOLI 1
144 | #define MODE_DASHU 2
145 | #define MODE_JINGSONG 3
146 | #define MODE_GAOGUAI 4
147 | #define MODE_KONGLING 5
148 | using namespace FMOD;
149 |
150 | JNIEXPORT void JNICALL Java_org_fmod_example_Utils_fix(JNIEnv *env,
151 | jclass jcls, jstring path_jstr, jint type) {
152 | //初始化
153 | System *system;
154 | Sound *sound;
155 | DSP *dsp;
156 | bool playing = true;
157 | Channel *channel;
158 | float frequency = 0;
159 | System_Create(&system);
160 | system->init(32, FMOD_INIT_NORMAL, NULL);//32通道
161 | const char* path_cstr = env->GetStringUTFChars(path_jstr, NULL);
162 | try {
163 |
164 | //创建声音
165 | system->createSound(path_cstr, FMOD_DEFAULT, NULL, &sound);
166 | switch (type) {
167 | case MODE_NORMAL:
168 | //原生播放
169 | LOGI("%s", path_cstr);
170 | system->playSound(sound, 0, false, &channel);
171 | LOGI("%s", "fix normal");
172 | break;
173 | case MODE_LUOLI:
174 | //loli
175 | //DSP digital singal process
176 | //dsp->音效
177 | //dsp 提升或者降低音调的一种音效
178 | system->createDSPByType(FMOD_DSP_TYPE_PITCHSHIFT, &dsp);
179 | //设置音调的参数
180 | dsp->setParameterFloat(FMOD_DSP_PITCHSHIFT_PITCH, 8.0);
181 | //添加进到channel
182 | system->playSound(sound, 0, false, &channel);
183 | channel->addDSP(0, dsp);
184 | break;
185 | case MODE_DASHU:
186 | //大叔
187 | system->createDSPByType(FMOD_DSP_TYPE_PITCHSHIFT, &dsp);
188 | //设置音调的参数
189 | dsp->setParameterFloat(FMOD_DSP_PITCHSHIFT_PITCH, 0.8);
190 | //添加进到channel
191 | system->playSound(sound, 0, false, &channel);
192 | channel->addDSP(0, dsp);
193 | break;
194 | case MODE_JINGSONG:
195 | //惊悚
196 | system->createDSPByType(FMOD_DSP_TYPE_TREMOLO, &dsp);
197 | dsp->setParameterFloat(FMOD_DSP_TREMOLO_SKEW, 5);
198 | system->playSound(sound, 0, false, &channel);
199 | channel->addDSP(0, dsp);
200 | break;
201 | case MODE_GAOGUAI:
202 | //搞怪
203 | //提高说话的速度
204 | system->playSound(sound, 0, false, &channel);
205 | channel->getFrequency(&frequency);
206 | frequency = frequency * 2;
207 | channel->setFrequency(frequency);
208 | break;
209 | case MODE_KONGLING:
210 | //空灵
211 | system->createDSPByType(FMOD_DSP_TYPE_ECHO, &dsp);
212 | dsp->setParameterFloat(FMOD_DSP_ECHO_DELAY, 300);
213 | dsp->setParameterFloat(FMOD_DSP_ECHO_FEEDBACK, 20);
214 | system->playSound(sound, 0, false, &channel);
215 | channel->addDSP(0, dsp);
216 | break;
217 | default:
218 | break;
219 | }
220 | } catch (...) {
221 | LOGE("%s", "发生异常");
222 | goto end;
223 | }
224 | system->update();
225 | //释放资源
226 | //单位是微妙
227 | //每秒钟判断下是否是播放
228 | while (playing) {
229 | channel->isPlaying(&playing);
230 | usleep(1000 * 1000);
231 | }
232 | goto end;
233 | end: env->ReleaseStringUTFChars(path_jstr, path_cstr);
234 | sound->release();
235 | system->close();
236 | system->release();
237 | }
238 |
239 | ```
240 |
241 | 举个例子比如在我们播放一段mp3的时候里面又人声,乐器声等,如果我想对其中一个钢琴的声音加一个特效
242 |
243 |
244 | 
245 |
246 | >那么怎么加呢!这就用到它了Channel *channel; 一般是32个通道修改完以后混音
247 |
248 |
249 |
250 |
251 |
252 |
253 | >好了到这里关键代码已经写完,我们可以测试玩玩了.
254 |
255 |
256 | ##项目源码下载地址:
257 |
258 | https://github.com/CN-ZPH/MySound.git
259 | 觉得不错请点一个star蛤!
260 | 有问题下面留言评论,我看到会回复。
261 |
262 |
263 |
--------------------------------------------------------------------------------
/jni/inc/fmod_output.h:
--------------------------------------------------------------------------------
1 | /* ======================================================================================================== */
2 | /* FMOD Studio - output development header file. Copyright (c), Firelight Technologies Pty, Ltd. 2004-2016. */
3 | /* */
4 | /* Use this header if you are wanting to develop your own output plugin to use with */
5 | /* FMOD's output system. With this header you can make your own output plugin that FMOD */
6 | /* can register and use. See the documentation and examples on how to make a working plugin. */
7 | /* */
8 | /* ======================================================================================================== */
9 |
10 | #ifndef _FMOD_OUTPUT_H
11 | #define _FMOD_OUTPUT_H
12 |
13 | #define FMOD_OUTPUT_PLUGIN_VERSION 1
14 |
15 | typedef struct FMOD_OUTPUT_STATE FMOD_OUTPUT_STATE;
16 | typedef struct FMOD_OUTPUT_OBJECT3DINFO FMOD_OUTPUT_OBJECT3DINFO;
17 |
18 | /*
19 | FMOD_OUTPUT_DESCRIPTION callbacks
20 | */
21 | typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_GETNUMDRIVERS_CALLBACK) (FMOD_OUTPUT_STATE *output_state, int *numdrivers);
22 | typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_GETDRIVERINFO_CALLBACK) (FMOD_OUTPUT_STATE *output_state, int id, char *name, int namelen, FMOD_GUID *guid, int *systemrate, FMOD_SPEAKERMODE *speakermode, int *speakermodechannels);
23 | typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_INIT_CALLBACK) (FMOD_OUTPUT_STATE *output_state, int selecteddriver, FMOD_INITFLAGS flags, int *outputrate, FMOD_SPEAKERMODE *speakermode, int *speakermodechannels, FMOD_SOUND_FORMAT *outputformat, int dspbufferlength, int dspnumbuffers, void *extradriverdata);
24 | typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_START_CALLBACK) (FMOD_OUTPUT_STATE *output_state);
25 | typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_STOP_CALLBACK) (FMOD_OUTPUT_STATE *output_state);
26 | typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_CLOSE_CALLBACK) (FMOD_OUTPUT_STATE *output_state);
27 | typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_UPDATE_CALLBACK) (FMOD_OUTPUT_STATE *output_state);
28 | typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_GETHANDLE_CALLBACK) (FMOD_OUTPUT_STATE *output_state, void **handle);
29 | typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_GETPOSITION_CALLBACK) (FMOD_OUTPUT_STATE *output_state, unsigned int *pcm);
30 | typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_LOCK_CALLBACK) (FMOD_OUTPUT_STATE *output_state, unsigned int offset, unsigned int length, void **ptr1, void **ptr2, unsigned int *len1, unsigned int *len2);
31 | typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_UNLOCK_CALLBACK) (FMOD_OUTPUT_STATE *output_state, void *ptr1, void *ptr2, unsigned int len1, unsigned int len2);
32 | typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_MIXER_CALLBACK) (FMOD_OUTPUT_STATE *output_state);
33 |
34 | typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_OBJECT3DGETINFO_CALLBACK) (FMOD_OUTPUT_STATE *output_state, int *maxhardwareobjects);
35 | typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_OBJECT3DALLOC_CALLBACK) (FMOD_OUTPUT_STATE *output_state, void **object3d);
36 | typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_OBJECT3DFREE_CALLBACK) (FMOD_OUTPUT_STATE *output_state, void *object3d);
37 | typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_OBJECT3DUPDATE_CALLBACK) (FMOD_OUTPUT_STATE *output_state, void *object3d, const FMOD_OUTPUT_OBJECT3DINFO *info);
38 |
39 | /*
40 | FMOD_OUTPUT_STATE functions
41 | */
42 | typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_READFROMMIXER) (FMOD_OUTPUT_STATE *output_state, void *buffer, unsigned int length);
43 | typedef void * (F_CALLBACK *FMOD_OUTPUT_ALLOC) (unsigned int size, unsigned int align, const char *file, int line);
44 | typedef void (F_CALLBACK *FMOD_OUTPUT_FREE) (void *ptr, const char *file, int line);
45 | typedef void (F_CALLBACK *FMOD_OUTPUT_LOG) (FMOD_DEBUG_FLAGS level, const char *file, int line, const char *function, const char *string, ...);
46 |
47 |
48 | /*
49 | [STRUCTURE]
50 | [
51 | [DESCRIPTION]
52 | When creating an output, declare one of these and provide the relevant callbacks and name for FMOD to use when it creates and uses an output of this type.
53 |
54 | [REMARKS]
55 | Members marked with [r] mean read only for the developer, read/write for the FMOD system.
56 | Members marked with [w] mean read/write for the developer, read only for the FMOD system.
57 |
58 | [SEE_ALSO]
59 | FMOD_OUTPUT_STATE
60 | ]
61 | */
62 | typedef struct FMOD_OUTPUT_DESCRIPTION
63 | {
64 | unsigned int apiversion; /* [w] The output plugin API version this plugin is built for. Set to this to FMOD_OUTPUT_PLUGIN_VERSION defined above. */
65 | const char *name; /* [w] Name of the output plugin. */
66 | unsigned int version; /* [w] Version of the output plugin. */
67 | int polling; /* [w] If FMOD should regularly call 'getposition' to determine when to automatically buffer and mix ('lock' and 'unlock') set to TRUE (non zero), for manual control call FMOD_OUTPUT_READFROMMIXER yourself. */
68 | FMOD_OUTPUT_GETNUMDRIVERS_CALLBACK getnumdrivers; /* [w] Number of attached sound devices. Called from System::getNumDrivers. */
69 | FMOD_OUTPUT_GETDRIVERINFO_CALLBACK getdriverinfo; /* [w] Information about a particular sound device. Called from System::getDriverInfo. */
70 | FMOD_OUTPUT_INIT_CALLBACK init; /* [w] Allocate resources and provide information about hardware capabilities. Called from System::init. */
71 | FMOD_OUTPUT_START_CALLBACK start; /* [w] Initialization is complete, mixing is about to begin. Called from System::init. */
72 | FMOD_OUTPUT_STOP_CALLBACK stop; /* [w] Mixing has finished, stop accepting audio data. Called from System::close. */
73 | FMOD_OUTPUT_CLOSE_CALLBACK close; /* [w] Clean up resources allocated during 'init'. Called from System::init and System::close. */
74 | FMOD_OUTPUT_UPDATE_CALLBACK update; /* [w] Update function that is called once a frame by the user. Called from System::update. */
75 | FMOD_OUTPUT_GETHANDLE_CALLBACK gethandle; /* [w] Return a pointer to the internal device object used to share with other audio systems. Called from System::getOutputHandle. */
76 | FMOD_OUTPUT_GETPOSITION_CALLBACK getposition; /* [w] ('polling' == TRUE) Provide the hardware playback position in the output ring buffer. Called before a mix. */
77 | FMOD_OUTPUT_LOCK_CALLBACK lock; /* [w] ('polling' == TRUE) Provide a pointer that FMOD can write to for the next block of audio data. Called before a mix. */
78 | FMOD_OUTPUT_UNLOCK_CALLBACK unlock; /* [w] ('polling' == TRUE) Optional callback to signify 'lock' has finished writing to the provided pointer. Called after a mix. */
79 | FMOD_OUTPUT_MIXER_CALLBACK mixer; /* [w] ('polling' == FALSE) Mixer thread that will continually retrigger. Wait on a synchronization primitive until ready, then call FMOD_OUTPUT_READFROMMIXER, then leave the callback (will retrigger immediately if mixer is still running). Called continually after FMOD_OUTPUT_START_CALLBACK and before FMOD_OUTPUT_STOP_CALLBACK. */
80 | FMOD_OUTPUT_OBJECT3DGETINFO_CALLBACK object3dgetinfo; /* [w] Provide information about the capabilities of the 3D object hardware. Called during a mix. */
81 | FMOD_OUTPUT_OBJECT3DALLOC_CALLBACK object3dalloc; /* [w] Reserve a hardware resources for a single 3D object. Called during a mix. */
82 | FMOD_OUTPUT_OBJECT3DFREE_CALLBACK object3dfree; /* [w] Release a hardware resource previously acquired with FMOD_OUTPUT_OBJECT3DALLOC_CALLBACK. Called during a mix. */
83 | FMOD_OUTPUT_OBJECT3DUPDATE_CALLBACK object3dupdate; /* [w] Called once for every acquired 3D object every mix to provide 3D information and buffered audio. Called during a mix. */
84 | } FMOD_OUTPUT_DESCRIPTION;
85 |
86 |
87 | /*
88 | [STRUCTURE]
89 | [
90 | [DESCRIPTION]
91 | Output object state passed into every callback provides access to plugin developers data and system functionality.
92 |
93 | [REMARKS]
94 | Members marked with [r] mean read only for the developer, read/write for the FMOD system.
95 | Members marked with [w] mean read/write for the developer, read only for the FMOD system.
96 |
97 | [SEE_ALSO]
98 | FMOD_OUTPUT_DESCRIPTION
99 | ]
100 | */
101 | struct FMOD_OUTPUT_STATE
102 | {
103 | void *plugindata; /* [w] Pointer used to store any plugin specific state so it's available in all callbacks. */
104 | FMOD_OUTPUT_READFROMMIXER readfrommixer; /* [r] Function to execute the mixer producing a buffer of audio. Used to control when the mix occurs manually as an alternative to FMOD_OUTPUT_DESCRIPTION::polling == TRUE. */
105 | FMOD_OUTPUT_ALLOC alloc; /* [r] Function to allocate memory using the FMOD memory system. */
106 | FMOD_OUTPUT_FREE free; /* [r] Function to free memory allocated with FMOD_OUTPUT_ALLOC. */
107 | FMOD_OUTPUT_LOG log; /* [r] Function to write to the FMOD logging system. */
108 | };
109 |
110 |
111 | /*
112 | [STRUCTURE]
113 | [
114 | [DESCRIPTION]
115 | This structure is passed to the plugin via FMOD_OUTPUT_OBJECT3DUPDATE_CALLBACK, so that whatever object based panning solution available can position it in the speakers correctly.
116 | Object based panning is a 3D panning solution that sends a mono only signal to a hardware device, such as Dolby Atmos or other similar panning solutions.
117 |
118 | [REMARKS]
119 | FMOD does not attenuate the buffer, but provides a 'gain' parameter that the user must use to scale the buffer by. Rather than pre-attenuating the buffer, the plugin developer
120 | can access untouched data for other purposes, like reverb sending for example.
121 | The 'gain' parameter is based on the user's 3D custom rolloff model.
122 |
123 | Members marked with [r] mean read only for the developer, read/write for the FMOD system.
124 | Members marked with [w] mean read/write for the developer, read only for the FMOD system.
125 |
126 | [SEE_ALSO]
127 | FMOD_OUTPUT_OBJECT3DUPDATE_CALLBACK
128 | ]
129 | */
130 | struct FMOD_OUTPUT_OBJECT3DINFO
131 | {
132 | float *buffer; /* [r] Mono PCM floating point buffer. This buffer needs to be scaled by the gain value to get distance attenuation. */
133 | unsigned int bufferlength; /* [r] Length in PCM samples of buffer. */
134 | FMOD_VECTOR position; /* [r] Vector relative between object and listener. */
135 | float gain; /* [r] 0.0 to 1.0 - 1 = 'buffer' is not attenuated, 0 = 'buffer' is fully attenuated. */
136 | float spread; /* [r] 0 - 360 degrees. 0 = point source, 360 = sound is spread around all speakers */
137 | float priority; /* [r] 0.0 to 1.0 - 0 = most important, 1 = least important. Based on height and distance (height is more important). */
138 | };
139 |
140 | #endif /* _FMOD_OUTPUT_H */
141 |
--------------------------------------------------------------------------------
/jni/inc/fmod_errors.h:
--------------------------------------------------------------------------------
1 | /*$ preserve start $*/
2 |
3 | /* ================================================================================================== */
4 | /* FMOD Studio - Error string header file. Copyright (c), Firelight Technologies Pty, Ltd. 2004-2016. */
5 | /* */
6 | /* Use this header if you want to store or display a string version / english explanation of */
7 | /* the FMOD error codes. */
8 | /* */
9 | /* ================================================================================================== */
10 |
11 | #ifndef _FMOD_ERRORS_H
12 | #define _FMOD_ERRORS_H
13 |
14 | #include "fmod.h"
15 |
16 | #ifdef __GNUC__
17 | static const char *FMOD_ErrorString(FMOD_RESULT errcode) __attribute__((unused));
18 | #endif
19 |
20 | static const char *FMOD_ErrorString(FMOD_RESULT errcode)
21 | {
22 | switch (errcode)
23 | {
24 | /*$ preserve end $*/
25 | case FMOD_OK: return "No errors.";
26 | case FMOD_ERR_BADCOMMAND: return "Tried to call a function on a data type that does not allow this type of functionality (ie calling Sound::lock on a streaming sound).";
27 | case FMOD_ERR_CHANNEL_ALLOC: return "Error trying to allocate a channel.";
28 | case FMOD_ERR_CHANNEL_STOLEN: return "The specified channel has been reused to play another sound.";
29 | case FMOD_ERR_DMA: return "DMA Failure. See debug output for more information.";
30 | case FMOD_ERR_DSP_CONNECTION: return "DSP connection error. Connection possibly caused a cyclic dependency or connected dsps with incompatible buffer counts.";
31 | case FMOD_ERR_DSP_DONTPROCESS: return "DSP return code from a DSP process query callback. Tells mixer not to call the process callback and therefore not consume CPU. Use this to optimize the DSP graph.";
32 | case FMOD_ERR_DSP_FORMAT: return "DSP Format error. A DSP unit may have attempted to connect to this network with the wrong format, or a matrix may have been set with the wrong size if the target unit has a specified channel map.";
33 | case FMOD_ERR_DSP_INUSE: return "DSP is already in the mixer's DSP network. It must be removed before being reinserted or released.";
34 | case FMOD_ERR_DSP_NOTFOUND: return "DSP connection error. Couldn't find the DSP unit specified.";
35 | case FMOD_ERR_DSP_RESERVED: return "DSP operation error. Cannot perform operation on this DSP as it is reserved by the system.";
36 | case FMOD_ERR_DSP_SILENCE: return "DSP return code from a DSP process query callback. Tells mixer silence would be produced from read, so go idle and not consume CPU. Use this to optimize the DSP graph.";
37 | case FMOD_ERR_DSP_TYPE: return "DSP operation cannot be performed on a DSP of this type.";
38 | case FMOD_ERR_FILE_BAD: return "Error loading file.";
39 | case FMOD_ERR_FILE_COULDNOTSEEK: return "Couldn't perform seek operation. This is a limitation of the medium (ie netstreams) or the file format.";
40 | case FMOD_ERR_FILE_DISKEJECTED: return "Media was ejected while reading.";
41 | case FMOD_ERR_FILE_EOF: return "End of file unexpectedly reached while trying to read essential data (truncated?).";
42 | case FMOD_ERR_FILE_ENDOFDATA: return "End of current chunk reached while trying to read data.";
43 | case FMOD_ERR_FILE_NOTFOUND: return "File not found.";
44 | case FMOD_ERR_FORMAT: return "Unsupported file or audio format.";
45 | case FMOD_ERR_HEADER_MISMATCH: return "There is a version mismatch between the FMOD header and either the FMOD Studio library or the FMOD Low Level library.";
46 | case FMOD_ERR_HTTP: return "A HTTP error occurred. This is a catch-all for HTTP errors not listed elsewhere.";
47 | case FMOD_ERR_HTTP_ACCESS: return "The specified resource requires authentication or is forbidden.";
48 | case FMOD_ERR_HTTP_PROXY_AUTH: return "Proxy authentication is required to access the specified resource.";
49 | case FMOD_ERR_HTTP_SERVER_ERROR: return "A HTTP server error occurred.";
50 | case FMOD_ERR_HTTP_TIMEOUT: return "The HTTP request timed out.";
51 | case FMOD_ERR_INITIALIZATION: return "FMOD was not initialized correctly to support this function.";
52 | case FMOD_ERR_INITIALIZED: return "Cannot call this command after System::init.";
53 | case FMOD_ERR_INTERNAL: return "An error occurred that wasn't supposed to. Contact support.";
54 | case FMOD_ERR_INVALID_FLOAT: return "Value passed in was a NaN, Inf or denormalized float.";
55 | case FMOD_ERR_INVALID_HANDLE: return "An invalid object handle was used.";
56 | case FMOD_ERR_INVALID_PARAM: return "An invalid parameter was passed to this function.";
57 | case FMOD_ERR_INVALID_POSITION: return "An invalid seek position was passed to this function.";
58 | case FMOD_ERR_INVALID_SPEAKER: return "An invalid speaker was passed to this function based on the current speaker mode.";
59 | case FMOD_ERR_INVALID_SYNCPOINT: return "The syncpoint did not come from this sound handle.";
60 | case FMOD_ERR_INVALID_THREAD: return "Tried to call a function on a thread that is not supported.";
61 | case FMOD_ERR_INVALID_VECTOR: return "The vectors passed in are not unit length, or perpendicular.";
62 | case FMOD_ERR_MAXAUDIBLE: return "Reached maximum audible playback count for this sound's soundgroup.";
63 | case FMOD_ERR_MEMORY: return "Not enough memory or resources.";
64 | case FMOD_ERR_MEMORY_CANTPOINT: return "Can't use FMOD_OPENMEMORY_POINT on non PCM source data, or non mp3/xma/adpcm data if FMOD_CREATECOMPRESSEDSAMPLE was used.";
65 | case FMOD_ERR_NEEDS3D: return "Tried to call a command on a 2d sound when the command was meant for 3d sound.";
66 | case FMOD_ERR_NEEDSHARDWARE: return "Tried to use a feature that requires hardware support.";
67 | case FMOD_ERR_NET_CONNECT: return "Couldn't connect to the specified host.";
68 | case FMOD_ERR_NET_SOCKET_ERROR: return "A socket error occurred. This is a catch-all for socket-related errors not listed elsewhere.";
69 | case FMOD_ERR_NET_URL: return "The specified URL couldn't be resolved.";
70 | case FMOD_ERR_NET_WOULD_BLOCK: return "Operation on a non-blocking socket could not complete immediately.";
71 | case FMOD_ERR_NOTREADY: return "Operation could not be performed because specified sound/DSP connection is not ready.";
72 | case FMOD_ERR_OUTPUT_ALLOCATED: return "Error initializing output device, but more specifically, the output device is already in use and cannot be reused.";
73 | case FMOD_ERR_OUTPUT_CREATEBUFFER: return "Error creating hardware sound buffer.";
74 | case FMOD_ERR_OUTPUT_DRIVERCALL: return "A call to a standard soundcard driver failed, which could possibly mean a bug in the driver or resources were missing or exhausted.";
75 | case FMOD_ERR_OUTPUT_FORMAT: return "Soundcard does not support the specified format.";
76 | case FMOD_ERR_OUTPUT_INIT: return "Error initializing output device.";
77 | case FMOD_ERR_OUTPUT_NODRIVERS: return "The output device has no drivers installed. If pre-init, FMOD_OUTPUT_NOSOUND is selected as the output mode. If post-init, the function just fails.";
78 | case FMOD_ERR_PLUGIN: return "An unspecified error has been returned from a plugin.";
79 | case FMOD_ERR_PLUGIN_MISSING: return "A requested output, dsp unit type or codec was not available.";
80 | case FMOD_ERR_PLUGIN_RESOURCE: return "A resource that the plugin requires cannot be found. (ie the DLS file for MIDI playback)";
81 | case FMOD_ERR_PLUGIN_VERSION: return "A plugin was built with an unsupported SDK version.";
82 | case FMOD_ERR_RECORD: return "An error occurred trying to initialize the recording device.";
83 | case FMOD_ERR_REVERB_CHANNELGROUP: return "Reverb properties cannot be set on this channel because a parent channelgroup owns the reverb connection.";
84 | case FMOD_ERR_REVERB_INSTANCE: return "Specified instance in FMOD_REVERB_PROPERTIES couldn't be set. Most likely because it is an invalid instance number or the reverb doesn't exist.";
85 | case FMOD_ERR_SUBSOUNDS: return "The error occurred because the sound referenced contains subsounds when it shouldn't have, or it doesn't contain subsounds when it should have. The operation may also not be able to be performed on a parent sound.";
86 | case FMOD_ERR_SUBSOUND_ALLOCATED: return "This subsound is already being used by another sound, you cannot have more than one parent to a sound. Null out the other parent's entry first.";
87 | case FMOD_ERR_SUBSOUND_CANTMOVE: return "Shared subsounds cannot be replaced or moved from their parent stream, such as when the parent stream is an FSB file.";
88 | case FMOD_ERR_TAGNOTFOUND: return "The specified tag could not be found or there are no tags.";
89 | case FMOD_ERR_TOOMANYCHANNELS: return "The sound created exceeds the allowable input channel count. This can be increased using the 'maxinputchannels' parameter in System::setSoftwareFormat.";
90 | case FMOD_ERR_TRUNCATED: return "The retrieved string is too long to fit in the supplied buffer and has been truncated.";
91 | case FMOD_ERR_UNIMPLEMENTED: return "Something in FMOD hasn't been implemented when it should be! contact support!";
92 | case FMOD_ERR_UNINITIALIZED: return "This command failed because System::init or System::setDriver was not called.";
93 | case FMOD_ERR_UNSUPPORTED: return "A command issued was not supported by this object. Possibly a plugin without certain callbacks specified.";
94 | case FMOD_ERR_VERSION: return "The version number of this file format is not supported.";
95 | case FMOD_ERR_EVENT_ALREADY_LOADED: return "The specified bank has already been loaded.";
96 | case FMOD_ERR_EVENT_LIVEUPDATE_BUSY: return "The live update connection failed due to the game already being connected.";
97 | case FMOD_ERR_EVENT_LIVEUPDATE_MISMATCH: return "The live update connection failed due to the game data being out of sync with the tool.";
98 | case FMOD_ERR_EVENT_LIVEUPDATE_TIMEOUT: return "The live update connection timed out.";
99 | case FMOD_ERR_EVENT_NOTFOUND: return "The requested event, bus or vca could not be found.";
100 | case FMOD_ERR_STUDIO_UNINITIALIZED: return "The Studio::System object is not yet initialized.";
101 | case FMOD_ERR_STUDIO_NOT_LOADED: return "The specified resource is not loaded, so it can't be unloaded.";
102 | case FMOD_ERR_INVALID_STRING: return "An invalid string was passed to this function.";
103 | case FMOD_ERR_ALREADY_LOCKED: return "The specified resource is already locked.";
104 | case FMOD_ERR_NOT_LOCKED: return "The specified resource is not locked, so it can't be unlocked.";
105 | case FMOD_ERR_RECORD_DISCONNECTED: return "The specified recording driver has been disconnected.";
106 | case FMOD_ERR_TOOMANYSAMPLES: return "The length provided exceeds the allowable limit.";
107 | default : return "Unknown error.";
108 | /*$ preserve start $*/
109 | };
110 | }
111 |
112 | #endif
113 | /*$ preserve end $*/
114 |
--------------------------------------------------------------------------------
/jni/inc/fmod_codec.h:
--------------------------------------------------------------------------------
1 | /* ======================================================================================================== */
2 | /* FMOD Studio - codec development header file. Copyright (c), Firelight Technologies Pty, Ltd. 2004-2016. */
3 | /* */
4 | /* Use this header if you are wanting to develop your own file format plugin to use with */
5 | /* FMOD's codec system. With this header you can make your own fileformat plugin that FMOD */
6 | /* can register and use. See the documentation and examples on how to make a working plugin. */
7 | /* */
8 | /* ======================================================================================================== */
9 |
10 | #ifndef _FMOD_CODEC_H
11 | #define _FMOD_CODEC_H
12 |
13 | typedef struct FMOD_CODEC_STATE FMOD_CODEC_STATE;
14 | typedef struct FMOD_CODEC_WAVEFORMAT FMOD_CODEC_WAVEFORMAT;
15 |
16 | /*
17 | Codec callbacks
18 | */
19 | typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_OPEN_CALLBACK) (FMOD_CODEC_STATE *codec_state, FMOD_MODE usermode, FMOD_CREATESOUNDEXINFO *userexinfo);
20 | typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_CLOSE_CALLBACK) (FMOD_CODEC_STATE *codec_state);
21 | typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_READ_CALLBACK) (FMOD_CODEC_STATE *codec_state, void *buffer, unsigned int samples_in, unsigned int *samples_out);
22 | typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_GETLENGTH_CALLBACK) (FMOD_CODEC_STATE *codec_state, unsigned int *length, FMOD_TIMEUNIT lengthtype);
23 | typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_SETPOSITION_CALLBACK) (FMOD_CODEC_STATE *codec_state, int subsound, unsigned int position, FMOD_TIMEUNIT postype);
24 | typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_GETPOSITION_CALLBACK) (FMOD_CODEC_STATE *codec_state, unsigned int *position, FMOD_TIMEUNIT postype);
25 | typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_SOUNDCREATE_CALLBACK) (FMOD_CODEC_STATE *codec_state, int subsound, FMOD_SOUND *sound);
26 | typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_METADATA_CALLBACK) (FMOD_CODEC_STATE *codec_state, FMOD_TAGTYPE tagtype, char *name, void *data, unsigned int datalen, FMOD_TAGDATATYPE datatype, int unique);
27 | typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_GETWAVEFORMAT_CALLBACK)(FMOD_CODEC_STATE *codec_state, int index, FMOD_CODEC_WAVEFORMAT *waveformat);
28 |
29 |
30 | /*
31 | [STRUCTURE]
32 | [
33 | [DESCRIPTION]
34 | When creating a codec, declare one of these and provide the relevant callbacks and name for FMOD to use when it opens and reads a file.
35 |
36 | [REMARKS]
37 | Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
38 | Members marked with [w] mean the variable can be written to. The user can set the value.
39 |
40 | [SEE_ALSO]
41 | FMOD_CODEC_STATE
42 | FMOD_CODEC_WAVEFORMAT
43 | ]
44 | */
45 | typedef struct FMOD_CODEC_DESCRIPTION
46 | {
47 | const char *name; /* [w] Name of the codec. */
48 | unsigned int version; /* [w] Plugin writer's version number. */
49 | int defaultasstream; /* [w] Tells FMOD to open the file as a stream when calling System::createSound, and not a static sample. Should normally be 0 (FALSE), because generally the user wants to decode the file into memory when using System::createSound. Mainly used for formats that decode for a very long time, or could use large amounts of memory when decoded. Usually sequenced formats such as mod/s3m/xm/it/midi fall into this category. It is mainly to stop users that don't know what they're doing from getting FMOD_ERR_MEMORY returned from createSound when they should have in fact called System::createStream or used FMOD_CREATESTREAM in System::createSound. */
50 | FMOD_TIMEUNIT timeunits; /* [w] When setposition codec is called, only these time formats will be passed to the codec. Use bitwise OR to accumulate different types. */
51 | FMOD_CODEC_OPEN_CALLBACK open; /* [w] Open callback for the codec for when FMOD tries to open a sound using this codec. */
52 | FMOD_CODEC_CLOSE_CALLBACK close; /* [w] Close callback for the codec for when FMOD tries to close a sound using this codec. */
53 | FMOD_CODEC_READ_CALLBACK read; /* [w] Read callback for the codec for when FMOD tries to read some data from the file to the destination format (specified in the open callback). */
54 | FMOD_CODEC_GETLENGTH_CALLBACK getlength; /* [w] Callback to return the length of the song in whatever format required when Sound::getLength is called. */
55 | FMOD_CODEC_SETPOSITION_CALLBACK setposition; /* [w] Seek callback for the codec for when FMOD tries to seek within the file with Channel::setPosition. */
56 | FMOD_CODEC_GETPOSITION_CALLBACK getposition; /* [w] Tell callback for the codec for when FMOD tries to get the current position within the with Channel::getPosition. */
57 | FMOD_CODEC_SOUNDCREATE_CALLBACK soundcreate; /* [w] Sound creation callback for the codec when FMOD finishes creating the sound. (So the codec can set more parameters for the related created sound, ie loop points/mode or 3D attributes etc). */
58 | FMOD_CODEC_GETWAVEFORMAT_CALLBACK getwaveformat; /* [w] Callback to tell FMOD about the waveformat of a particular subsound. This is to save memory, rather than saving 1000 FMOD_CODEC_WAVEFORMAT structures in the codec, the codec might have a more optimal way of storing this information. */
59 | } FMOD_CODEC_DESCRIPTION;
60 |
61 |
62 | /*
63 | [STRUCTURE]
64 | [
65 | [DESCRIPTION]
66 | Set these values marked to tell fmod what sort of sound to create when the codec open callback is called.
67 | The format, channels, frequency and lengthpcm tell FMOD what sort of sound buffer to create when you initialize your code.
68 | If you wrote an MP3 codec that decoded to stereo 16bit integer PCM for a 44khz sound, you would specify FMOD_SOUND_FORMAT_PCM16, and channels would be equal to 2, and frequency would be 44100.
69 |
70 | [REMARKS]
71 | Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
72 | Members marked with [w] mean the variable can be written to. The user can set the value.
73 |
74 | 1.07 Note. 'blockalign' member which was in bytes has been removed. 'pcmblocksize' is now the replacement, and is measured in PCM samples only, not bytes. This is purely to support buffering
75 | internal to FMOD for codecs that are not sample accurate.
76 |
77 | Note: When registering a codec, format, channels, frequency and lengthpcm must be supplied, otherwise there will be an error.
78 | This structure is optional if FMOD_CODEC_GETWAVEFORMAT_CALLBACK is specified.
79 | An array of these structures may be needed if FMOD_CODEC_STATE::numsubsounds is larger than 1.
80 |
81 |
82 | [SEE_ALSO]
83 | FMOD_CODEC_STATE
84 | FMOD_SOUND_FORMAT
85 | FMOD_MODE
86 | FMOD_CHANNELMASK
87 | FMOD_CHANNELORDER
88 | FMOD_CODEC_WAVEFORMAT_VERSION
89 | ]
90 | */
91 | struct FMOD_CODEC_WAVEFORMAT
92 | {
93 | char name[256]; /* [w] Name of sound. Optional. */
94 | FMOD_SOUND_FORMAT format; /* [w] Format for (decompressed) codec output, ie FMOD_SOUND_FORMAT_PCM8, FMOD_SOUND_FORMAT_PCM16. Mandantory - Must be supplied. */
95 | int channels; /* [w] Number of channels used by codec, ie mono = 1, stereo = 2. Mandantory - Must be supplied. */
96 | int frequency; /* [w] Default frequency in hz of the codec, ie 44100. Mandantory - Must be supplied. */
97 | unsigned int lengthbytes; /* [w] Length in bytes of the source data. Used for FMOD_TIMEUNIT_RAWBYTES. Optional. Default = 0. */
98 | unsigned int lengthpcm; /* [w] Length in decompressed, PCM samples of the file, ie length in seconds * frequency. Used for Sound::getLength and for memory allocation of static decompressed sample data. Mandantory - Must be supplied. */
99 | unsigned int pcmblocksize; /* [w] Minimum, optimal number of decompressed PCM samples codec can handle. 0 or 1 = no buffering. Anything higher means FMOD will allocate a PCM buffer of this size to read in chunks. The codec read callback will be called in multiples of this value. Optional. */
100 | int loopstart; /* [w] Loopstart in decompressed, PCM samples of file. Optional. Default = 0. */
101 | int loopend; /* [w] Loopend in decompressed, PCM samples of file. Optional. Default = 0. */
102 | FMOD_MODE mode; /* [w] Mode to determine whether the sound should by default load as looping, non looping, 2d or 3d. Optional. Default = FMOD_DEFAULT. */
103 | FMOD_CHANNELMASK channelmask; /* [w] Defined channel bitmask to describe which speakers the channels in the codec map to, in order of channel count. See fmod_common.h. Optional. Leave at 0 to map to the speaker layout defined in FMOD_SPEAKER. */
104 | FMOD_CHANNELORDER channelorder; /* [w] Defined channel order type, to describe where each sound channel should pan for the number of channels specified. See fmod_common.h. Optional. Leave at 0 to play in default speaker order. */
105 | float peakvolume; /* [w] Peak volume of sound. Optional. Default = 0 if not used. */
106 | };
107 |
108 |
109 | /*
110 | [DEFINE]
111 | [
112 | [NAME]
113 | FMOD_CODEC_WAVEFORMAT_VERSION
114 |
115 | [DESCRIPTION]
116 | Version number of FMOD_CODEC_WAVEFORMAT structure. Should be set into FMOD_CODEC_STATE in the FMOD_CODEC_OPEN_CALLBACK.
117 |
118 | [REMARKS]
119 | Use this for binary compatibility and for future expansion.
120 |
121 | [SEE_ALSO]
122 | FMOD_CODEC_STATE
123 | FMOD_CODEC_DESCRIPTION
124 | FMOD_CODEC_OPEN_CALLBACK
125 | ]
126 | */
127 | #define FMOD_CODEC_WAVEFORMAT_VERSION 2
128 | /* [DEFINE_END] */
129 |
130 |
131 | /*
132 | [STRUCTURE]
133 | [
134 | [DESCRIPTION]
135 | Codec plugin structure that is passed into each callback.
136 |
137 | Optionally set the numsubsounds and waveformat members when called in FMOD_CODEC_OPEN_CALLBACK to tell fmod what sort of sound to create.
138 |
139 | [REMARKS]
140 | Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
141 | Members marked with [w] mean the variable can be written to. The user can set the value.
142 |
143 | 'numsubsounds' should be 0 if the file is a normal single sound stream or sound. Examples of this would be .WAV, .WMA, .MP3, .AIFF.
144 | 'numsubsounds' should be 1+ if the file is a container format, and does not contain wav data itself. Examples of these types would be FSB (contains multiple sounds), DLS (contain instruments).
145 | The waveformat value should point to an arrays of information based on how many subsounds are in the format. If the number of subsounds is 0 then it should point to 1 waveformat, the same as if the number of subsounds was 1. If subsounds was 100 for example, there should be a pointer to an array of 100 waveformat structures.
146 |
147 | The waveformat pointer is optional and could be 0, if using FMOD_CODEC_GETWAVEFORMAT_CALLBACK is preferred.
148 |
149 | When a sound has 1 or more subsounds, the caller must play the individual sounds specified by first obtaining the subsound with Sound::getSubSound.
150 |
151 | [SEE_ALSO]
152 | FMOD_CODEC_WAVEFORMAT
153 | FMOD_FILE_READ_CALLBACK
154 | FMOD_FILE_SEEK_CALLBACK
155 | FMOD_CODEC_METADATA_CALLBACK
156 | Sound::getSubSound
157 | Sound::getNumSubSounds
158 | FMOD_CODEC_WAVEFORMAT_VERSION
159 | ]
160 | */
161 | struct FMOD_CODEC_STATE
162 | {
163 | int numsubsounds; /* [w] Number of 'subsounds' in this sound. Anything other than 0 makes it a 'container' format (ie DLS/FSB etc which contain 1 or more subsounds). For most normal, single sound codec such as WAV/AIFF/MP3, this should be 0 as they are not a container for subsounds, they are the sound by itself. */
164 | FMOD_CODEC_WAVEFORMAT *waveformat; /* [w] Pointer to an array of format structures containing information about each sample. Can be 0 or NULL if FMOD_CODEC_GETWAVEFORMAT_CALLBACK callback is preferred. The number of entries here must equal the number of subsounds defined in the subsound parameter. If numsubsounds = 0 then there should be 1 instance of this structure. */
165 | void *plugindata; /* [w] Plugin writer created data the codec author wants to attach to this object. */
166 |
167 | void *filehandle; /* [r] This will return an internal FMOD file handle to use with the callbacks provided. */
168 | unsigned int filesize; /* [r] This will contain the size of the file in bytes. */
169 | FMOD_FILE_READ_CALLBACK fileread; /* [r] This will return a callable FMOD file function to use from codec. */
170 | FMOD_FILE_SEEK_CALLBACK fileseek; /* [r] This will return a callable FMOD file function to use from codec. */
171 | FMOD_CODEC_METADATA_CALLBACK metadata; /* [r] This will return a callable FMOD metadata function to use from codec. */
172 |
173 | int waveformatversion; /* [w] Must be set to FMOD_CODEC_WAVEFORMAT_VERSION in the FMOD_CODEC_OPEN_CALLBACK. */
174 | };
175 |
176 | #endif
177 |
178 |
179 |
--------------------------------------------------------------------------------
/jni/inc/fmod.hpp:
--------------------------------------------------------------------------------
1 | /* ========================================================================================== */
2 | /* FMOD Studio - C++ header file. Copyright (c), Firelight Technologies Pty, Ltd. 2004-2016. */
3 | /* */
4 | /* Use this header in conjunction with fmod_common.h (which contains all the constants / */
5 | /* callbacks) to develop using C++ classes. */
6 | /* ========================================================================================== */
7 |
8 | #ifndef _FMOD_HPP
9 | #define _FMOD_HPP
10 |
11 | #include "fmod_common.h"
12 | #include "fmod.h"
13 |
14 | /*
15 | Constant and defines
16 | */
17 |
18 | /*
19 | FMOD Namespace
20 | */
21 | namespace FMOD
22 | {
23 | class System;
24 | class Sound;
25 | class ChannelControl;
26 | class Channel;
27 | class ChannelGroup;
28 | class SoundGroup;
29 | class DSP;
30 | class DSPConnection;
31 | class Geometry;
32 | class Reverb3D;
33 |
34 | /*
35 | FMOD global system functions (optional).
36 | */
37 | inline FMOD_RESULT Memory_Initialize (void *poolmem, int poollen, FMOD_MEMORY_ALLOC_CALLBACK useralloc, FMOD_MEMORY_REALLOC_CALLBACK userrealloc, FMOD_MEMORY_FREE_CALLBACK userfree, FMOD_MEMORY_TYPE memtypeflags = FMOD_MEMORY_ALL) { return FMOD_Memory_Initialize(poolmem, poollen, useralloc, userrealloc, userfree, memtypeflags); }
38 | inline FMOD_RESULT Memory_GetStats (int *currentalloced, int *maxalloced, bool blocking = true) { return FMOD_Memory_GetStats(currentalloced, maxalloced, blocking); }
39 | inline FMOD_RESULT Debug_Initialize (FMOD_DEBUG_FLAGS flags, FMOD_DEBUG_MODE mode = FMOD_DEBUG_MODE_TTY, FMOD_DEBUG_CALLBACK callback = 0, const char *filename = 0) { return FMOD_Debug_Initialize(flags, mode, callback, filename); }
40 | inline FMOD_RESULT File_SetDiskBusy (int busy) { return FMOD_File_SetDiskBusy(busy); }
41 | inline FMOD_RESULT File_GetDiskBusy (int *busy) { return FMOD_File_GetDiskBusy(busy); }
42 |
43 | /*
44 | FMOD System factory functions.
45 | */
46 | inline FMOD_RESULT System_Create (System **system) { return FMOD_System_Create((FMOD_SYSTEM **)system); }
47 |
48 | /*
49 | 'System' API
50 | */
51 | class System
52 | {
53 | private:
54 |
55 | // Constructor made private so user cannot statically instance a System class. System_Create must be used.
56 | System();
57 | System(const System &);
58 |
59 | public:
60 |
61 | FMOD_RESULT F_API release ();
62 |
63 | // Setup functions.
64 | FMOD_RESULT F_API setOutput (FMOD_OUTPUTTYPE output);
65 | FMOD_RESULT F_API getOutput (FMOD_OUTPUTTYPE *output);
66 | FMOD_RESULT F_API getNumDrivers (int *numdrivers);
67 | FMOD_RESULT F_API getDriverInfo (int id, char *name, int namelen, FMOD_GUID *guid, int *systemrate, FMOD_SPEAKERMODE *speakermode, int *speakermodechannels);
68 | FMOD_RESULT F_API setDriver (int driver);
69 | FMOD_RESULT F_API getDriver (int *driver);
70 | FMOD_RESULT F_API setSoftwareChannels (int numsoftwarechannels);
71 | FMOD_RESULT F_API getSoftwareChannels (int *numsoftwarechannels);
72 | FMOD_RESULT F_API setSoftwareFormat (int samplerate, FMOD_SPEAKERMODE speakermode, int numrawspeakers);
73 | FMOD_RESULT F_API getSoftwareFormat (int *samplerate, FMOD_SPEAKERMODE *speakermode, int *numrawspeakers);
74 | FMOD_RESULT F_API setDSPBufferSize (unsigned int bufferlength, int numbuffers);
75 | FMOD_RESULT F_API getDSPBufferSize (unsigned int *bufferlength, int *numbuffers);
76 | FMOD_RESULT F_API setFileSystem (FMOD_FILE_OPEN_CALLBACK useropen, FMOD_FILE_CLOSE_CALLBACK userclose, FMOD_FILE_READ_CALLBACK userread, FMOD_FILE_SEEK_CALLBACK userseek, FMOD_FILE_ASYNCREAD_CALLBACK userasyncread, FMOD_FILE_ASYNCCANCEL_CALLBACK userasynccancel, int blockalign);
77 | FMOD_RESULT F_API attachFileSystem (FMOD_FILE_OPEN_CALLBACK useropen, FMOD_FILE_CLOSE_CALLBACK userclose, FMOD_FILE_READ_CALLBACK userread, FMOD_FILE_SEEK_CALLBACK userseek);
78 | FMOD_RESULT F_API setAdvancedSettings (FMOD_ADVANCEDSETTINGS *settings);
79 | FMOD_RESULT F_API getAdvancedSettings (FMOD_ADVANCEDSETTINGS *settings);
80 | FMOD_RESULT F_API setCallback (FMOD_SYSTEM_CALLBACK callback, FMOD_SYSTEM_CALLBACK_TYPE callbackmask = FMOD_SYSTEM_CALLBACK_ALL);
81 |
82 | // Plug-in support.
83 | FMOD_RESULT F_API setPluginPath (const char *path);
84 | FMOD_RESULT F_API loadPlugin (const char *filename, unsigned int *handle, unsigned int priority = 0);
85 | FMOD_RESULT F_API unloadPlugin (unsigned int handle);
86 | FMOD_RESULT F_API getNumNestedPlugins (unsigned int handle, int *count);
87 | FMOD_RESULT F_API getNestedPlugin (unsigned int handle, int index, unsigned int *nestedhandle);
88 | FMOD_RESULT F_API getNumPlugins (FMOD_PLUGINTYPE plugintype, int *numplugins);
89 | FMOD_RESULT F_API getPluginHandle (FMOD_PLUGINTYPE plugintype, int index, unsigned int *handle);
90 | FMOD_RESULT F_API getPluginInfo (unsigned int handle, FMOD_PLUGINTYPE *plugintype, char *name, int namelen, unsigned int *version);
91 | FMOD_RESULT F_API setOutputByPlugin (unsigned int handle);
92 | FMOD_RESULT F_API getOutputByPlugin (unsigned int *handle);
93 | FMOD_RESULT F_API createDSPByPlugin (unsigned int handle, DSP **dsp);
94 | FMOD_RESULT F_API getDSPInfoByPlugin (unsigned int handle, const FMOD_DSP_DESCRIPTION **description);
95 | FMOD_RESULT F_API registerCodec (FMOD_CODEC_DESCRIPTION *description, unsigned int *handle, unsigned int priority = 0);
96 | FMOD_RESULT F_API registerDSP (const FMOD_DSP_DESCRIPTION *description, unsigned int *handle);
97 | FMOD_RESULT F_API registerOutput (const FMOD_OUTPUT_DESCRIPTION *description, unsigned int *handle);
98 |
99 | // Init/Close.
100 | FMOD_RESULT F_API init (int maxchannels, FMOD_INITFLAGS flags, void *extradriverdata);
101 | FMOD_RESULT F_API close ();
102 |
103 | // General post-init system functions.
104 | FMOD_RESULT F_API update (); /* IMPORTANT! CALL THIS ONCE PER FRAME! */
105 |
106 | FMOD_RESULT F_API setSpeakerPosition (FMOD_SPEAKER speaker, float x, float y, bool active);
107 | FMOD_RESULT F_API getSpeakerPosition (FMOD_SPEAKER speaker, float *x, float *y, bool *active);
108 | FMOD_RESULT F_API setStreamBufferSize (unsigned int filebuffersize, FMOD_TIMEUNIT filebuffersizetype);
109 | FMOD_RESULT F_API getStreamBufferSize (unsigned int *filebuffersize, FMOD_TIMEUNIT *filebuffersizetype);
110 | FMOD_RESULT F_API set3DSettings (float dopplerscale, float distancefactor, float rolloffscale);
111 | FMOD_RESULT F_API get3DSettings (float *dopplerscale, float *distancefactor, float *rolloffscale);
112 | FMOD_RESULT F_API set3DNumListeners (int numlisteners);
113 | FMOD_RESULT F_API get3DNumListeners (int *numlisteners);
114 | FMOD_RESULT F_API set3DListenerAttributes (int listener, const FMOD_VECTOR *pos, const FMOD_VECTOR *vel, const FMOD_VECTOR *forward, const FMOD_VECTOR *up);
115 | FMOD_RESULT F_API get3DListenerAttributes (int listener, FMOD_VECTOR *pos, FMOD_VECTOR *vel, FMOD_VECTOR *forward, FMOD_VECTOR *up);
116 | FMOD_RESULT F_API set3DRolloffCallback (FMOD_3D_ROLLOFF_CALLBACK callback);
117 | FMOD_RESULT F_API mixerSuspend ();
118 | FMOD_RESULT F_API mixerResume ();
119 | FMOD_RESULT F_API getDefaultMixMatrix (FMOD_SPEAKERMODE sourcespeakermode, FMOD_SPEAKERMODE targetspeakermode, float *matrix, int matrixhop);
120 | FMOD_RESULT F_API getSpeakerModeChannels (FMOD_SPEAKERMODE mode, int *channels);
121 |
122 | // System information functions.
123 | FMOD_RESULT F_API getVersion (unsigned int *version);
124 | FMOD_RESULT F_API getOutputHandle (void **handle);
125 | FMOD_RESULT F_API getChannelsPlaying (int *channels, int *realchannels = 0);
126 | FMOD_RESULT F_API getCPUUsage (float *dsp, float *stream, float *geometry, float *update, float *total);
127 | FMOD_RESULT F_API getFileUsage (long long *sampleBytesRead, long long *streamBytesRead, long long *otherBytesRead);
128 | FMOD_RESULT F_API getSoundRAM (int *currentalloced, int *maxalloced, int *total);
129 |
130 | // Sound/DSP/Channel/FX creation and retrieval.
131 | FMOD_RESULT F_API createSound (const char *name_or_data, FMOD_MODE mode, FMOD_CREATESOUNDEXINFO *exinfo, Sound **sound);
132 | FMOD_RESULT F_API createStream (const char *name_or_data, FMOD_MODE mode, FMOD_CREATESOUNDEXINFO *exinfo, Sound **sound);
133 | FMOD_RESULT F_API createDSP (const FMOD_DSP_DESCRIPTION *description, DSP **dsp);
134 | FMOD_RESULT F_API createDSPByType (FMOD_DSP_TYPE type, DSP **dsp);
135 | FMOD_RESULT F_API createChannelGroup (const char *name, ChannelGroup **channelgroup);
136 | FMOD_RESULT F_API createSoundGroup (const char *name, SoundGroup **soundgroup);
137 | FMOD_RESULT F_API createReverb3D (Reverb3D **reverb);
138 |
139 | FMOD_RESULT F_API playSound (Sound *sound, ChannelGroup *channelgroup, bool paused, Channel **channel);
140 | FMOD_RESULT F_API playDSP (DSP *dsp, ChannelGroup *channelgroup, bool paused, Channel **channel);
141 | FMOD_RESULT F_API getChannel (int channelid, Channel **channel);
142 | FMOD_RESULT F_API getMasterChannelGroup (ChannelGroup **channelgroup);
143 | FMOD_RESULT F_API getMasterSoundGroup (SoundGroup **soundgroup);
144 |
145 | // Routing to ports.
146 | FMOD_RESULT F_API attachChannelGroupToPort (FMOD_PORT_TYPE portType, FMOD_PORT_INDEX portIndex, ChannelGroup *channelgroup, bool passThru = false);
147 | FMOD_RESULT F_API detachChannelGroupFromPort (ChannelGroup *channelgroup);
148 |
149 | // Reverb API.
150 | FMOD_RESULT F_API setReverbProperties (int instance, const FMOD_REVERB_PROPERTIES *prop);
151 | FMOD_RESULT F_API getReverbProperties (int instance, FMOD_REVERB_PROPERTIES *prop);
152 |
153 | // System level DSP functionality.
154 | FMOD_RESULT F_API lockDSP ();
155 | FMOD_RESULT F_API unlockDSP ();
156 |
157 | // Recording API.
158 | FMOD_RESULT F_API getRecordNumDrivers (int *numdrivers, int *numconnected);
159 | FMOD_RESULT F_API getRecordDriverInfo (int id, char *name, int namelen, FMOD_GUID *guid, int *systemrate, FMOD_SPEAKERMODE *speakermode, int *speakermodechannels, FMOD_DRIVER_STATE *state);
160 | FMOD_RESULT F_API getRecordPosition (int id, unsigned int *position);
161 | FMOD_RESULT F_API recordStart (int id, Sound *sound, bool loop);
162 | FMOD_RESULT F_API recordStop (int id);
163 | FMOD_RESULT F_API isRecording (int id, bool *recording);
164 |
165 | // Geometry API.
166 | FMOD_RESULT F_API createGeometry (int maxpolygons, int maxvertices, Geometry **geometry);
167 | FMOD_RESULT F_API setGeometrySettings (float maxworldsize);
168 | FMOD_RESULT F_API getGeometrySettings (float *maxworldsize);
169 | FMOD_RESULT F_API loadGeometry (const void *data, int datasize, Geometry **geometry);
170 | FMOD_RESULT F_API getGeometryOcclusion (const FMOD_VECTOR *listener, const FMOD_VECTOR *source, float *direct, float *reverb);
171 |
172 | // Network functions.
173 | FMOD_RESULT F_API setNetworkProxy (const char *proxy);
174 | FMOD_RESULT F_API getNetworkProxy (char *proxy, int proxylen);
175 | FMOD_RESULT F_API setNetworkTimeout (int timeout);
176 | FMOD_RESULT F_API getNetworkTimeout (int *timeout);
177 |
178 | // Userdata set/get.
179 | FMOD_RESULT F_API setUserData (void *userdata);
180 | FMOD_RESULT F_API getUserData (void **userdata);
181 | };
182 |
183 | /*
184 | 'Sound' API
185 | */
186 | class Sound
187 | {
188 | private:
189 |
190 | // Constructor made private so user cannot statically instance a Sound class. Appropriate Sound creation or retrieval function must be used.
191 | Sound();
192 | Sound(const Sound &);
193 |
194 | public:
195 |
196 | FMOD_RESULT F_API release ();
197 | FMOD_RESULT F_API getSystemObject (System **system);
198 |
199 | // Standard sound manipulation functions.
200 | FMOD_RESULT F_API lock (unsigned int offset, unsigned int length, void **ptr1, void **ptr2, unsigned int *len1, unsigned int *len2);
201 | FMOD_RESULT F_API unlock (void *ptr1, void *ptr2, unsigned int len1, unsigned int len2);
202 | FMOD_RESULT F_API setDefaults (float frequency, int priority);
203 | FMOD_RESULT F_API getDefaults (float *frequency, int *priority);
204 | FMOD_RESULT F_API set3DMinMaxDistance (float min, float max);
205 | FMOD_RESULT F_API get3DMinMaxDistance (float *min, float *max);
206 | FMOD_RESULT F_API set3DConeSettings (float insideconeangle, float outsideconeangle, float outsidevolume);
207 | FMOD_RESULT F_API get3DConeSettings (float *insideconeangle, float *outsideconeangle, float *outsidevolume);
208 | FMOD_RESULT F_API set3DCustomRolloff (FMOD_VECTOR *points, int numpoints);
209 | FMOD_RESULT F_API get3DCustomRolloff (FMOD_VECTOR **points, int *numpoints);
210 | FMOD_RESULT F_API getSubSound (int index, Sound **subsound);
211 | FMOD_RESULT F_API getSubSoundParent (Sound **parentsound);
212 | FMOD_RESULT F_API getName (char *name, int namelen);
213 | FMOD_RESULT F_API getLength (unsigned int *length, FMOD_TIMEUNIT lengthtype);
214 | FMOD_RESULT F_API getFormat (FMOD_SOUND_TYPE *type, FMOD_SOUND_FORMAT *format, int *channels, int *bits);
215 | FMOD_RESULT F_API getNumSubSounds (int *numsubsounds);
216 | FMOD_RESULT F_API getNumTags (int *numtags, int *numtagsupdated);
217 | FMOD_RESULT F_API getTag (const char *name, int index, FMOD_TAG *tag);
218 | FMOD_RESULT F_API getOpenState (FMOD_OPENSTATE *openstate, unsigned int *percentbuffered, bool *starving, bool *diskbusy);
219 | FMOD_RESULT F_API readData (void *buffer, unsigned int lenbytes, unsigned int *read);
220 | FMOD_RESULT F_API seekData (unsigned int pcm);
221 |
222 | FMOD_RESULT F_API setSoundGroup (SoundGroup *soundgroup);
223 | FMOD_RESULT F_API getSoundGroup (SoundGroup **soundgroup);
224 |
225 | // Synchronization point API. These points can come from markers embedded in wav files, and can also generate channel callbacks.
226 | FMOD_RESULT F_API getNumSyncPoints (int *numsyncpoints);
227 | FMOD_RESULT F_API getSyncPoint (int index, FMOD_SYNCPOINT **point);
228 | FMOD_RESULT F_API getSyncPointInfo (FMOD_SYNCPOINT *point, char *name, int namelen, unsigned int *offset, FMOD_TIMEUNIT offsettype);
229 | FMOD_RESULT F_API addSyncPoint (unsigned int offset, FMOD_TIMEUNIT offsettype, const char *name, FMOD_SYNCPOINT **point);
230 | FMOD_RESULT F_API deleteSyncPoint (FMOD_SYNCPOINT *point);
231 |
232 | // Functions also in Channel class but here they are the 'default' to save having to change it in Channel all the time.
233 | FMOD_RESULT F_API setMode (FMOD_MODE mode);
234 | FMOD_RESULT F_API getMode (FMOD_MODE *mode);
235 | FMOD_RESULT F_API setLoopCount (int loopcount);
236 | FMOD_RESULT F_API getLoopCount (int *loopcount);
237 | FMOD_RESULT F_API setLoopPoints (unsigned int loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int loopend, FMOD_TIMEUNIT loopendtype);
238 | FMOD_RESULT F_API getLoopPoints (unsigned int *loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int *loopend, FMOD_TIMEUNIT loopendtype);
239 |
240 | // For MOD/S3M/XM/IT/MID sequenced formats only.
241 | FMOD_RESULT F_API getMusicNumChannels (int *numchannels);
242 | FMOD_RESULT F_API setMusicChannelVolume (int channel, float volume);
243 | FMOD_RESULT F_API getMusicChannelVolume (int channel, float *volume);
244 | FMOD_RESULT F_API setMusicSpeed (float speed);
245 | FMOD_RESULT F_API getMusicSpeed (float *speed);
246 |
247 | // Userdata set/get.
248 | FMOD_RESULT F_API setUserData (void *userdata);
249 | FMOD_RESULT F_API getUserData (void **userdata);
250 | };
251 |
252 |
253 | /*
254 | 'ChannelControl API'. This is a base class for Channel and ChannelGroup so they can share the same functionality. This cannot be used or instansiated explicitly.
255 | */
256 | class ChannelControl
257 | {
258 | private:
259 |
260 | // Constructor made private so user cannot statically instance a Control class.
261 | ChannelControl();
262 | ChannelControl(const ChannelControl &);
263 |
264 | public:
265 |
266 | FMOD_RESULT F_API getSystemObject (System **system);
267 |
268 | // General control functionality for Channels and ChannelGroups.
269 | FMOD_RESULT F_API stop ();
270 | FMOD_RESULT F_API setPaused (bool paused);
271 | FMOD_RESULT F_API getPaused (bool *paused);
272 | FMOD_RESULT F_API setVolume (float volume);
273 | FMOD_RESULT F_API getVolume (float *volume);
274 | FMOD_RESULT F_API setVolumeRamp (bool ramp);
275 | FMOD_RESULT F_API getVolumeRamp (bool *ramp);
276 | FMOD_RESULT F_API getAudibility (float *audibility);
277 | FMOD_RESULT F_API setPitch (float pitch);
278 | FMOD_RESULT F_API getPitch (float *pitch);
279 | FMOD_RESULT F_API setMute (bool mute);
280 | FMOD_RESULT F_API getMute (bool *mute);
281 | FMOD_RESULT F_API setReverbProperties (int instance, float wet);
282 | FMOD_RESULT F_API getReverbProperties (int instance, float *wet);
283 | FMOD_RESULT F_API setLowPassGain (float gain);
284 | FMOD_RESULT F_API getLowPassGain (float *gain);
285 | FMOD_RESULT F_API setMode (FMOD_MODE mode);
286 | FMOD_RESULT F_API getMode (FMOD_MODE *mode);
287 | FMOD_RESULT F_API setCallback (FMOD_CHANNELCONTROL_CALLBACK callback);
288 | FMOD_RESULT F_API isPlaying (bool *isplaying);
289 |
290 | // Panning and level adjustment.
291 | // Note all 'set' functions alter a final matrix, this is why the only get function is getMixMatrix, to avoid other get functions returning incorrect/obsolete values.
292 | FMOD_RESULT F_API setPan (float pan);
293 | FMOD_RESULT F_API setMixLevelsOutput (float frontleft, float frontright, float center, float lfe, float surroundleft, float surroundright, float backleft, float backright);
294 | FMOD_RESULT F_API setMixLevelsInput (float *levels, int numlevels);
295 | FMOD_RESULT F_API setMixMatrix (float *matrix, int outchannels, int inchannels, int inchannel_hop = 0);
296 | FMOD_RESULT F_API getMixMatrix (float *matrix, int *outchannels, int *inchannels, int inchannel_hop = 0);
297 |
298 | // Clock based functionality.
299 | FMOD_RESULT F_API getDSPClock (unsigned long long *dspclock, unsigned long long *parentclock);
300 | FMOD_RESULT F_API setDelay (unsigned long long dspclock_start, unsigned long long dspclock_end, bool stopchannels = true);
301 | FMOD_RESULT F_API getDelay (unsigned long long *dspclock_start, unsigned long long *dspclock_end, bool *stopchannels = 0);
302 | FMOD_RESULT F_API addFadePoint (unsigned long long dspclock, float volume);
303 | FMOD_RESULT F_API setFadePointRamp (unsigned long long dspclock, float volume);
304 | FMOD_RESULT F_API removeFadePoints (unsigned long long dspclock_start, unsigned long long dspclock_end);
305 | FMOD_RESULT F_API getFadePoints (unsigned int *numpoints, unsigned long long *point_dspclock, float *point_volume);
306 |
307 | // DSP effects.
308 | FMOD_RESULT F_API getDSP (int index, DSP **dsp);
309 | FMOD_RESULT F_API addDSP (int index, DSP *dsp);
310 | FMOD_RESULT F_API removeDSP (DSP *dsp);
311 | FMOD_RESULT F_API getNumDSPs (int *numdsps);
312 | FMOD_RESULT F_API setDSPIndex (DSP *dsp, int index);
313 | FMOD_RESULT F_API getDSPIndex (DSP *dsp, int *index);
314 | FMOD_RESULT F_API overridePanDSP (DSP *pan);
315 |
316 | // 3D functionality.
317 | FMOD_RESULT F_API set3DAttributes (const FMOD_VECTOR *pos, const FMOD_VECTOR *vel, const FMOD_VECTOR *alt_pan_pos = 0);
318 | FMOD_RESULT F_API get3DAttributes (FMOD_VECTOR *pos, FMOD_VECTOR *vel, FMOD_VECTOR *alt_pan_pos = 0);
319 | FMOD_RESULT F_API set3DMinMaxDistance (float mindistance, float maxdistance);
320 | FMOD_RESULT F_API get3DMinMaxDistance (float *mindistance, float *maxdistance);
321 | FMOD_RESULT F_API set3DConeSettings (float insideconeangle, float outsideconeangle, float outsidevolume);
322 | FMOD_RESULT F_API get3DConeSettings (float *insideconeangle, float *outsideconeangle, float *outsidevolume);
323 | FMOD_RESULT F_API set3DConeOrientation (FMOD_VECTOR *orientation);
324 | FMOD_RESULT F_API get3DConeOrientation (FMOD_VECTOR *orientation);
325 | FMOD_RESULT F_API set3DCustomRolloff (FMOD_VECTOR *points, int numpoints);
326 | FMOD_RESULT F_API get3DCustomRolloff (FMOD_VECTOR **points, int *numpoints);
327 | FMOD_RESULT F_API set3DOcclusion (float directocclusion, float reverbocclusion);
328 | FMOD_RESULT F_API get3DOcclusion (float *directocclusion, float *reverbocclusion);
329 | FMOD_RESULT F_API set3DSpread (float angle);
330 | FMOD_RESULT F_API get3DSpread (float *angle);
331 | FMOD_RESULT F_API set3DLevel (float level);
332 | FMOD_RESULT F_API get3DLevel (float *level);
333 | FMOD_RESULT F_API set3DDopplerLevel (float level);
334 | FMOD_RESULT F_API get3DDopplerLevel (float *level);
335 | FMOD_RESULT F_API set3DDistanceFilter (bool custom, float customLevel, float centerFreq);
336 | FMOD_RESULT F_API get3DDistanceFilter (bool *custom, float *customLevel, float *centerFreq);
337 |
338 | // Userdata set/get.
339 | FMOD_RESULT F_API setUserData (void *userdata);
340 | FMOD_RESULT F_API getUserData (void **userdata);
341 | };
342 |
343 | /*
344 | 'Channel' API.
345 | */
346 | class Channel : public ChannelControl
347 | {
348 | private:
349 |
350 | // Constructor made private so user cannot statically instance a Channel class. Appropriate Channel creation or retrieval function must be used.
351 | Channel();
352 | Channel(const Channel &);
353 |
354 | public:
355 |
356 | // Channel specific control functionality.
357 | FMOD_RESULT F_API setFrequency (float frequency);
358 | FMOD_RESULT F_API getFrequency (float *frequency);
359 | FMOD_RESULT F_API setPriority (int priority);
360 | FMOD_RESULT F_API getPriority (int *priority);
361 | FMOD_RESULT F_API setPosition (unsigned int position, FMOD_TIMEUNIT postype);
362 | FMOD_RESULT F_API getPosition (unsigned int *position, FMOD_TIMEUNIT postype);
363 | FMOD_RESULT F_API setChannelGroup (ChannelGroup *channelgroup);
364 | FMOD_RESULT F_API getChannelGroup (ChannelGroup **channelgroup);
365 | FMOD_RESULT F_API setLoopCount (int loopcount);
366 | FMOD_RESULT F_API getLoopCount (int *loopcount);
367 | FMOD_RESULT F_API setLoopPoints (unsigned int loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int loopend, FMOD_TIMEUNIT loopendtype);
368 | FMOD_RESULT F_API getLoopPoints (unsigned int *loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int *loopend, FMOD_TIMEUNIT loopendtype);
369 |
370 | // Information only functions.
371 | FMOD_RESULT F_API isVirtual (bool *isvirtual);
372 | FMOD_RESULT F_API getCurrentSound (Sound **sound);
373 | FMOD_RESULT F_API getIndex (int *index);
374 | };
375 |
376 | /*
377 | 'ChannelGroup' API
378 | */
379 | class ChannelGroup : public ChannelControl
380 | {
381 | private:
382 |
383 | // Constructor made private so user cannot statically instance a ChannelGroup class. Appropriate ChannelGroup creation or retrieval function must be used.
384 | ChannelGroup();
385 | ChannelGroup(const ChannelGroup &);
386 |
387 | public:
388 |
389 | FMOD_RESULT F_API release ();
390 |
391 | // Nested channel groups.
392 | FMOD_RESULT F_API addGroup (ChannelGroup *group, bool propagatedspclock = true, DSPConnection **connection = 0);
393 | FMOD_RESULT F_API getNumGroups (int *numgroups);
394 | FMOD_RESULT F_API getGroup (int index, ChannelGroup **group);
395 | FMOD_RESULT F_API getParentGroup (ChannelGroup **group);
396 |
397 | // Information only functions.
398 | FMOD_RESULT F_API getName (char *name, int namelen);
399 | FMOD_RESULT F_API getNumChannels (int *numchannels);
400 | FMOD_RESULT F_API getChannel (int index, Channel **channel);
401 | };
402 |
403 | /*
404 | 'SoundGroup' API
405 | */
406 | class SoundGroup
407 | {
408 | private:
409 |
410 | // Constructor made private so user cannot statically instance a SoundGroup class. Appropriate SoundGroup creation or retrieval function must be used.
411 | SoundGroup();
412 | SoundGroup(const SoundGroup &);
413 |
414 | public:
415 |
416 | FMOD_RESULT F_API release ();
417 | FMOD_RESULT F_API getSystemObject (System **system);
418 |
419 | // SoundGroup control functions.
420 | FMOD_RESULT F_API setMaxAudible (int maxaudible);
421 | FMOD_RESULT F_API getMaxAudible (int *maxaudible);
422 | FMOD_RESULT F_API setMaxAudibleBehavior (FMOD_SOUNDGROUP_BEHAVIOR behavior);
423 | FMOD_RESULT F_API getMaxAudibleBehavior (FMOD_SOUNDGROUP_BEHAVIOR *behavior);
424 | FMOD_RESULT F_API setMuteFadeSpeed (float speed);
425 | FMOD_RESULT F_API getMuteFadeSpeed (float *speed);
426 | FMOD_RESULT F_API setVolume (float volume);
427 | FMOD_RESULT F_API getVolume (float *volume);
428 | FMOD_RESULT F_API stop ();
429 |
430 | // Information only functions.
431 | FMOD_RESULT F_API getName (char *name, int namelen);
432 | FMOD_RESULT F_API getNumSounds (int *numsounds);
433 | FMOD_RESULT F_API getSound (int index, Sound **sound);
434 | FMOD_RESULT F_API getNumPlaying (int *numplaying);
435 |
436 | // Userdata set/get.
437 | FMOD_RESULT F_API setUserData (void *userdata);
438 | FMOD_RESULT F_API getUserData (void **userdata);
439 | };
440 |
441 | /*
442 | 'DSP' API
443 | */
444 | class DSP
445 | {
446 | private:
447 |
448 | // Constructor made private so user cannot statically instance a DSP class. Appropriate DSP creation or retrieval function must be used.
449 | DSP();
450 | DSP(const DSP &);
451 |
452 | public:
453 |
454 | FMOD_RESULT F_API release ();
455 | FMOD_RESULT F_API getSystemObject (System **system);
456 |
457 | // Connection / disconnection / input and output enumeration.
458 | FMOD_RESULT F_API addInput (DSP *input, DSPConnection **connection = 0, FMOD_DSPCONNECTION_TYPE type = FMOD_DSPCONNECTION_TYPE_STANDARD);
459 | FMOD_RESULT F_API disconnectFrom (DSP *target, DSPConnection *connection = 0);
460 | FMOD_RESULT F_API disconnectAll (bool inputs, bool outputs);
461 | FMOD_RESULT F_API getNumInputs (int *numinputs);
462 | FMOD_RESULT F_API getNumOutputs (int *numoutputs);
463 | FMOD_RESULT F_API getInput (int index, DSP **input, DSPConnection **inputconnection);
464 | FMOD_RESULT F_API getOutput (int index, DSP **output, DSPConnection **outputconnection);
465 |
466 | // DSP unit control.
467 | FMOD_RESULT F_API setActive (bool active);
468 | FMOD_RESULT F_API getActive (bool *active);
469 | FMOD_RESULT F_API setBypass (bool bypass);
470 | FMOD_RESULT F_API getBypass (bool *bypass);
471 | FMOD_RESULT F_API setWetDryMix (float prewet, float postwet, float dry);
472 | FMOD_RESULT F_API getWetDryMix (float *prewet, float *postwet, float *dry);
473 | FMOD_RESULT F_API setChannelFormat (FMOD_CHANNELMASK channelmask, int numchannels, FMOD_SPEAKERMODE source_speakermode);
474 | FMOD_RESULT F_API getChannelFormat (FMOD_CHANNELMASK *channelmask, int *numchannels, FMOD_SPEAKERMODE *source_speakermode);
475 | FMOD_RESULT F_API getOutputChannelFormat (FMOD_CHANNELMASK inmask, int inchannels, FMOD_SPEAKERMODE inspeakermode, FMOD_CHANNELMASK *outmask, int *outchannels, FMOD_SPEAKERMODE *outspeakermode);
476 | FMOD_RESULT F_API reset ();
477 |
478 | // DSP parameter control.
479 | FMOD_RESULT F_API setParameterFloat (int index, float value);
480 | FMOD_RESULT F_API setParameterInt (int index, int value);
481 | FMOD_RESULT F_API setParameterBool (int index, bool value);
482 | FMOD_RESULT F_API setParameterData (int index, void *data, unsigned int length);
483 | FMOD_RESULT F_API getParameterFloat (int index, float *value, char *valuestr, int valuestrlen);
484 | FMOD_RESULT F_API getParameterInt (int index, int *value, char *valuestr, int valuestrlen);
485 | FMOD_RESULT F_API getParameterBool (int index, bool *value, char *valuestr, int valuestrlen);
486 | FMOD_RESULT F_API getParameterData (int index, void **data, unsigned int *length, char *valuestr, int valuestrlen);
487 | FMOD_RESULT F_API getNumParameters (int *numparams);
488 | FMOD_RESULT F_API getParameterInfo (int index, FMOD_DSP_PARAMETER_DESC **desc);
489 | FMOD_RESULT F_API getDataParameterIndex (int datatype, int *index);
490 | FMOD_RESULT F_API showConfigDialog (void *hwnd, bool show);
491 |
492 | // DSP attributes.
493 | FMOD_RESULT F_API getInfo (char *name, unsigned int *version, int *channels, int *configwidth, int *configheight);
494 | FMOD_RESULT F_API getType (FMOD_DSP_TYPE *type);
495 | FMOD_RESULT F_API getIdle (bool *idle);
496 |
497 | // Userdata set/get.
498 | FMOD_RESULT F_API setUserData (void *userdata);
499 | FMOD_RESULT F_API getUserData (void **userdata);
500 |
501 | // Metering.
502 | FMOD_RESULT F_API setMeteringEnabled (bool inputEnabled, bool outputEnabled);
503 | FMOD_RESULT F_API getMeteringEnabled (bool *inputEnabled, bool *outputEnabled);
504 | FMOD_RESULT F_API getMeteringInfo (FMOD_DSP_METERING_INFO *inputInfo, FMOD_DSP_METERING_INFO *outputInfo);
505 | };
506 |
507 |
508 | /*
509 | 'DSPConnection' API
510 | */
511 | class DSPConnection
512 | {
513 | private:
514 |
515 | // Constructor made private so user cannot statically instance a DSPConnection class. Appropriate DSPConnection creation or retrieval function must be used.
516 | DSPConnection();
517 | DSPConnection(const DSPConnection &);
518 |
519 | public:
520 |
521 | FMOD_RESULT F_API getInput (DSP **input);
522 | FMOD_RESULT F_API getOutput (DSP **output);
523 | FMOD_RESULT F_API setMix (float volume);
524 | FMOD_RESULT F_API getMix (float *volume);
525 | FMOD_RESULT F_API setMixMatrix (float *matrix, int outchannels, int inchannels, int inchannel_hop = 0);
526 | FMOD_RESULT F_API getMixMatrix (float *matrix, int *outchannels, int *inchannels, int inchannel_hop = 0);
527 | FMOD_RESULT F_API getType (FMOD_DSPCONNECTION_TYPE *type);
528 |
529 | // Userdata set/get.
530 | FMOD_RESULT F_API setUserData (void *userdata);
531 | FMOD_RESULT F_API getUserData (void **userdata);
532 | };
533 |
534 |
535 | /*
536 | 'Geometry' API
537 | */
538 | class Geometry
539 | {
540 | private:
541 |
542 | // Constructor made private so user cannot statically instance a Geometry class. Appropriate Geometry creation or retrieval function must be used.
543 | Geometry();
544 | Geometry(const Geometry &);
545 |
546 | public:
547 |
548 | FMOD_RESULT F_API release ();
549 |
550 | // Polygon manipulation.
551 | FMOD_RESULT F_API addPolygon (float directocclusion, float reverbocclusion, bool doublesided, int numvertices, const FMOD_VECTOR *vertices, int *polygonindex);
552 | FMOD_RESULT F_API getNumPolygons (int *numpolygons);
553 | FMOD_RESULT F_API getMaxPolygons (int *maxpolygons, int *maxvertices);
554 | FMOD_RESULT F_API getPolygonNumVertices (int index, int *numvertices);
555 | FMOD_RESULT F_API setPolygonVertex (int index, int vertexindex, const FMOD_VECTOR *vertex);
556 | FMOD_RESULT F_API getPolygonVertex (int index, int vertexindex, FMOD_VECTOR *vertex);
557 | FMOD_RESULT F_API setPolygonAttributes (int index, float directocclusion, float reverbocclusion, bool doublesided);
558 | FMOD_RESULT F_API getPolygonAttributes (int index, float *directocclusion, float *reverbocclusion, bool *doublesided);
559 |
560 | // Object manipulation.
561 | FMOD_RESULT F_API setActive (bool active);
562 | FMOD_RESULT F_API getActive (bool *active);
563 | FMOD_RESULT F_API setRotation (const FMOD_VECTOR *forward, const FMOD_VECTOR *up);
564 | FMOD_RESULT F_API getRotation (FMOD_VECTOR *forward, FMOD_VECTOR *up);
565 | FMOD_RESULT F_API setPosition (const FMOD_VECTOR *position);
566 | FMOD_RESULT F_API getPosition (FMOD_VECTOR *position);
567 | FMOD_RESULT F_API setScale (const FMOD_VECTOR *scale);
568 | FMOD_RESULT F_API getScale (FMOD_VECTOR *scale);
569 | FMOD_RESULT F_API save (void *data, int *datasize);
570 |
571 | // Userdata set/get.
572 | FMOD_RESULT F_API setUserData (void *userdata);
573 | FMOD_RESULT F_API getUserData (void **userdata);
574 | };
575 |
576 |
577 | /*
578 | 'Reverb' API
579 | */
580 | class Reverb3D
581 | {
582 | private:
583 |
584 | // Constructor made private so user cannot statically instance a Reverb3D class. Appropriate Reverb creation or retrieval function must be used.
585 | Reverb3D();
586 | Reverb3D(const Reverb3D &);
587 |
588 | public:
589 |
590 | FMOD_RESULT F_API release ();
591 |
592 | // Reverb manipulation.
593 | FMOD_RESULT F_API set3DAttributes (const FMOD_VECTOR *position, float mindistance, float maxdistance);
594 | FMOD_RESULT F_API get3DAttributes (FMOD_VECTOR *position, float *mindistance,float *maxdistance);
595 | FMOD_RESULT F_API setProperties (const FMOD_REVERB_PROPERTIES *properties);
596 | FMOD_RESULT F_API getProperties (FMOD_REVERB_PROPERTIES *properties);
597 | FMOD_RESULT F_API setActive (bool active);
598 | FMOD_RESULT F_API getActive (bool *active);
599 |
600 | // Userdata set/get.
601 | FMOD_RESULT F_API setUserData (void *userdata);
602 | FMOD_RESULT F_API getUserData (void **userdata);
603 | };
604 | }
605 |
606 | #endif
607 |
--------------------------------------------------------------------------------
/jni/inc/fmod_dsp.h:
--------------------------------------------------------------------------------
1 | /* ========================================================================================== */
2 | /* FMOD Studio - DSP header file. Copyright (c), Firelight Technologies Pty, Ltd. 2004-2016. */
3 | /* */
4 | /* Use this header if you are interested in delving deeper into the FMOD software mixing / */
5 | /* DSP engine. */
6 | /* Also use this header if you are wanting to develop your own DSP plugin to use with FMOD's */
7 | /* dsp system. With this header you can make your own DSP plugin that FMOD can */
8 | /* register and use. See the documentation and examples on how to make a working plugin. */
9 | /* */
10 | /* ========================================================================================== */
11 |
12 | #ifndef _FMOD_DSP_H
13 | #define _FMOD_DSP_H
14 |
15 | #include "fmod_dsp_effects.h"
16 |
17 | typedef struct FMOD_DSP_STATE FMOD_DSP_STATE;
18 |
19 | /*
20 | [STRUCTURE]
21 | [
22 | [DESCRIPTION]
23 | Structure for FMOD_DSP_PROCESS_CALLBACK input and output buffers.
24 |
25 | [REMARKS]
26 | Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
27 | Members marked with [w] mean the variable can be written to. The user can set the value.
28 |
29 | [SEE_ALSO]
30 | FMOD_DSP_DESCRIPTION
31 | ]
32 | */
33 | typedef struct FMOD_DSP_BUFFER_ARRAY
34 | {
35 | int numbuffers; /* [r/w] number of buffers */
36 | int *buffernumchannels; /* [r/w] array of number of channels for each buffer */
37 | FMOD_CHANNELMASK *bufferchannelmask; /* [r/w] array of channel masks for each buffer */
38 | float **buffers; /* [r/w] array of buffers */
39 | FMOD_SPEAKERMODE speakermode; /* [r/w] speaker mode for all buffers in the array */
40 | } FMOD_DSP_BUFFER_ARRAY;
41 |
42 | /*
43 | [ENUM]
44 | [
45 | [DESCRIPTION]
46 | Operation type for FMOD_DSP_PROCESS_CALLBACK.
47 |
48 | [REMARKS]
49 | A process callback will be called twice per mix for a DSP unit. Once with the FMOD_DSP_PROCESS_QUERY command, then conditionally, FMOD_DSP_PROCESS_PERFORM.
50 | FMOD_DSP_PROCESS_QUERY is to be handled only by filling out the outputarray information, and returning a relevant return code.
51 | It should not really do any logic besides checking and returning one of the following codes:
52 | - FMOD_OK - Meaning yes, it should execute the dsp process function with FMOD_DSP_PROCESS_PERFORM
53 | - FMOD_ERR_DSP_DONTPROCESS - Meaning no, it should skip the process function and not call it with FMOD_DSP_PROCESS_PERFORM.
54 | - FMOD_ERR_DSP_SILENCE - Meaning no, it should skip the process function and not call it with FMOD_DSP_PROCESS_PERFORM, AND, tell the signal chain to follow that it is now idle, so that no more processing happens down the chain.
55 | If audio is to be processed, 'outbufferarray' must be filled with the expected output format, channel count and mask. Mask can be 0.
56 |
57 | FMOD_DSP_PROCESS_PROCESS is to be handled by reading the data from the input, processing it, and writing it to the output. Always write to the output buffer and fill it fully to avoid unpredictable audio output.
58 | Always return FMOD_OK, the return value is ignored from the process stage.
59 |
60 | [SEE_ALSO]
61 | FMOD_DSP_DESCRIPTION
62 | ]
63 | */
64 | typedef enum
65 | {
66 | FMOD_DSP_PROCESS_PERFORM, /* Process the incoming audio in 'inbufferarray' and output to 'outbufferarray'. */
67 | FMOD_DSP_PROCESS_QUERY /* The DSP is being queried for the expected output format and whether it needs to process audio or should be bypassed. The function should return FMOD_OK, or FMOD_ERR_DSP_DONTPROCESS or FMOD_ERR_DSP_SILENCE if audio can pass through unprocessed. See remarks for more. If audio is to be processed, 'outbufferarray' must be filled with the expected output format, channel count and mask. */
68 | } FMOD_DSP_PROCESS_OPERATION;
69 |
70 | /*
71 | [STRUCTURE]
72 | [
73 | [DESCRIPTION]
74 | Complex number structure used for holding FFT frequency domain-data for FMOD_FFTREAL and FMOD_IFFTREAL DSP callbacks.
75 |
76 | [REMARKS]
77 |
78 | [SEE_ALSO]
79 | FMOD_DSP_STATE_SYSTEMCALLBACKS
80 | ]
81 | */
82 | typedef struct FMOD_COMPLEX
83 | {
84 | float real; /* Real component */
85 | float imag; /* Imaginary component */
86 | } FMOD_COMPLEX;
87 |
88 | /*
89 | [ENUM]
90 | [
91 | [DESCRIPTION]
92 | Flags for the FMOD_DSP_PAN_SUM_SURROUND_MATRIX callback.
93 |
94 | [REMARKS]
95 | This functionality is experimental, please contact support@fmod.org for more information.
96 |
97 | [SEE_ALSO]
98 | FMOD_DSP_STATE_PAN_CALLBACKS
99 | ]
100 | */
101 | typedef enum
102 | {
103 | FMOD_DSP_PAN_SURROUND_DEFAULT = 0,
104 | FMOD_DSP_PAN_SURROUND_ROTATION_NOT_BIASED = 1,
105 |
106 | FMOD_DSP_PAN_SURROUND_FLAGS_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */
107 | } FMOD_DSP_PAN_SURROUND_FLAGS;
108 |
109 | /*
110 | DSP callbacks
111 | */
112 | typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_CREATE_CALLBACK) (FMOD_DSP_STATE *dsp_state);
113 | typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_RELEASE_CALLBACK) (FMOD_DSP_STATE *dsp_state);
114 | typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_RESET_CALLBACK) (FMOD_DSP_STATE *dsp_state);
115 | typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_READ_CALLBACK) (FMOD_DSP_STATE *dsp_state, float *inbuffer, float *outbuffer, unsigned int length, int inchannels, int *outchannels);
116 | typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_PROCESS_CALLBACK) (FMOD_DSP_STATE *dsp_state, unsigned int length, const FMOD_DSP_BUFFER_ARRAY *inbufferarray, FMOD_DSP_BUFFER_ARRAY *outbufferarray, FMOD_BOOL inputsidle, FMOD_DSP_PROCESS_OPERATION op);
117 | typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_SETPOSITION_CALLBACK) (FMOD_DSP_STATE *dsp_state, unsigned int pos);
118 | typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_SHOULDIPROCESS_CALLBACK) (FMOD_DSP_STATE *dsp_state, FMOD_BOOL inputsidle, unsigned int length, FMOD_CHANNELMASK inmask, int inchannels, FMOD_SPEAKERMODE speakermode);
119 |
120 | typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_SETPARAM_FLOAT_CALLBACK) (FMOD_DSP_STATE *dsp_state, int index, float value);
121 | typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_SETPARAM_INT_CALLBACK) (FMOD_DSP_STATE *dsp_state, int index, int value);
122 | typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_SETPARAM_BOOL_CALLBACK) (FMOD_DSP_STATE *dsp_state, int index, FMOD_BOOL value);
123 | typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_SETPARAM_DATA_CALLBACK) (FMOD_DSP_STATE *dsp_state, int index, void *data, unsigned int length);
124 | typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_GETPARAM_FLOAT_CALLBACK) (FMOD_DSP_STATE *dsp_state, int index, float *value, char *valuestr);
125 | typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_GETPARAM_INT_CALLBACK) (FMOD_DSP_STATE *dsp_state, int index, int *value, char *valuestr);
126 | typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_GETPARAM_BOOL_CALLBACK) (FMOD_DSP_STATE *dsp_state, int index, FMOD_BOOL *value, char *valuestr);
127 | typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_GETPARAM_DATA_CALLBACK) (FMOD_DSP_STATE *dsp_state, int index, void **data, unsigned int *length, char *valuestr);
128 |
129 | typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_SYSTEM_REGISTER_CALLBACK) (FMOD_DSP_STATE *dsp_state);
130 | typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_SYSTEM_DEREGISTER_CALLBACK) (FMOD_DSP_STATE *dsp_state);
131 | typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_SYSTEM_MIX_CALLBACK) (FMOD_DSP_STATE *dsp_state, int stage);
132 |
133 | typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_SYSTEM_GETSAMPLERATE) (FMOD_DSP_STATE *dsp_state, int *rate);
134 | typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_SYSTEM_GETBLOCKSIZE) (FMOD_DSP_STATE *dsp_state, unsigned int *blocksize);
135 | typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_SYSTEM_GETSPEAKERMODE) (FMOD_DSP_STATE *dsp_state, FMOD_SPEAKERMODE *speakermode_mixer, FMOD_SPEAKERMODE *speakermode_output);
136 |
137 | typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_DFT_FFTREAL) (FMOD_DSP_STATE* thisdsp, int size, const float *signal, FMOD_COMPLEX* dft, const float *window, int signalhop);
138 | typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_DFT_IFFTREAL) (FMOD_DSP_STATE* thisdsp, int size, const FMOD_COMPLEX *dft, float* signal, const float *window, int signalhop);
139 |
140 | typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_PAN_SUM_MONO_MATRIX) (FMOD_DSP_STATE *dsp_state, int sourceSpeakerMode, float lowFrequencyGain, float overallGain, float *matrix);
141 | typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_PAN_SUM_STEREO_MATRIX) (FMOD_DSP_STATE *dsp_state, int sourceSpeakerMode, float pan, float lowFrequencyGain, float overallGain, int matrixHop, float *matrix);
142 | typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_PAN_SUM_SURROUND_MATRIX) (FMOD_DSP_STATE *dsp_state, int sourceSpeakerMode, int targetSpeakerMode, float direction, float extent, float rotation, float lowFrequencyGain, float overallGain, int matrixHop, float *matrix, FMOD_DSP_PAN_SURROUND_FLAGS flags);
143 | typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_PAN_SUM_MONO_TO_SURROUND_MATRIX) (FMOD_DSP_STATE *dsp_state, int targetSpeakerMode, float direction, float extent, float lowFrequencyGain, float overallGain, int matrixHop, float *matrix);
144 | typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_PAN_SUM_STEREO_TO_SURROUND_MATRIX)(FMOD_DSP_STATE *dsp_state, int targetSpeakerMode, float direction, float extent, float rotation, float lowFrequencyGain, float overallGain, int matrixHop, float *matrix);
145 | typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_PAN_3D_GET_ROLLOFF_GAIN) (FMOD_DSP_STATE *dsp_state, FMOD_DSP_PAN_3D_ROLLOFF_TYPE rolloff, float distance, float mindistance, float maxdistance, float *gain);
146 |
147 | typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_STATE_GETCLOCK) (FMOD_DSP_STATE *dsp_state, unsigned long long *clock, unsigned int *offset, unsigned int *length);
148 |
149 |
150 | /*
151 | [DEFINE]
152 | [
153 | [NAME]
154 | FMOD_DSP_GETPARAM_VALUESTR_LENGTH
155 |
156 | [DESCRIPTION]
157 | Length in bytes of the buffer pointed to by the valuestr argument of FMOD_DSP_GETPARAM_XXXX_CALLBACK functions.
158 |
159 | [REMARKS]
160 | DSP plugins should not copy more than this number of bytes into the buffer or memory corruption will occur.
161 |
162 | [SEE_ALSO]
163 | FMOD_DSP_GETPARAM_FLOAT_CALLBACK
164 | FMOD_DSP_GETPARAM_INT_CALLBACK
165 | FMOD_DSP_GETPARAM_BOOL_CALLBACK
166 | FMOD_DSP_GETPARAM_DATA_CALLBACK
167 | ]
168 | */
169 | #define FMOD_DSP_GETPARAM_VALUESTR_LENGTH 32
170 | /* [DEFINE_END] */
171 |
172 | /*
173 | [ENUM]
174 | [
175 | [DESCRIPTION]
176 | DSP parameter types.
177 |
178 | [REMARKS]
179 |
180 | [SEE_ALSO]
181 | FMOD_DSP_PARAMETER_DESC
182 | ]
183 | */
184 | typedef enum
185 | {
186 | FMOD_DSP_PARAMETER_TYPE_FLOAT,
187 | FMOD_DSP_PARAMETER_TYPE_INT,
188 | FMOD_DSP_PARAMETER_TYPE_BOOL,
189 | FMOD_DSP_PARAMETER_TYPE_DATA,
190 |
191 | FMOD_DSP_PARAMETER_TYPE_MAX, /* Maximum number of DSP parameter types. */
192 | FMOD_DSP_PARAMETER_TYPE_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */
193 | } FMOD_DSP_PARAMETER_TYPE;
194 |
195 |
196 | /*
197 | [ENUM]
198 | [
199 | [DESCRIPTION]
200 | DSP float parameter mappings. These determine how values are mapped across dials and automation curves.
201 |
202 | [REMARKS]
203 | FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE_AUTO generates a mapping based on range and units. For example, if the units are in Hertz and the range is with-in the audio spectrum, a Bark scale will be chosen. Logarithmic scales may also be generated for ranges above zero spanning several orders of magnitude.
204 |
205 | [SEE_ALSO]
206 | FMOD_DSP_PARAMETER_FLOAT_MAPPING
207 | ]
208 | */
209 | typedef enum
210 | {
211 | FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE_LINEAR, /* Values mapped linearly across range. */
212 | FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE_AUTO, /* A mapping is automatically chosen based on range and units. See remarks. */
213 | FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE_PIECEWISE_LINEAR, /* Values mapped in a piecewise linear fashion defined by FMOD_DSP_PARAMETER_FLOAT_MAPPING_PIECEWISE_LINEAR. */
214 |
215 | FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */
216 | } FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE;
217 |
218 | /*
219 | [STRUCTURE]
220 | [
221 | [DESCRIPTION]
222 | Structure to define a piecewise linear mapping.
223 |
224 | [REMARKS]
225 | Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
226 | Members marked with [w] mean the variable can be written to. The user can set the value.
227 |
228 | [SEE_ALSO]
229 | FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE
230 | FMOD_DSP_PARAMETER_FLOAT_MAPPING
231 | ]
232 | */
233 | typedef struct FMOD_DSP_PARAMETER_FLOAT_MAPPING_PIECEWISE_LINEAR
234 | {
235 | int numpoints; /* [w] The number of pairs in the piecewise mapping (at least 2). */
236 | float *pointparamvalues; /* [w] The values in the parameter's units for each point */
237 | float *pointpositions; /* [w] The positions along the control's scale (e.g. dial angle) corresponding to each parameter value. The range of this scale is arbitrary and all positions will be relative to the minimum and maximum values (e.g. [0,1,3] is equivalent to [1,2,4] and [2,4,8]). If this array is zero, pointparamvalues will be distributed with equal spacing. */
238 | } FMOD_DSP_PARAMETER_FLOAT_MAPPING_PIECEWISE_LINEAR;
239 |
240 |
241 | /*
242 | [STRUCTURE]
243 | [
244 | [DESCRIPTION]
245 | Structure to define a mapping for a DSP unit's float parameter.
246 |
247 | [REMARKS]
248 | Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
249 | Members marked with [w] mean the variable can be written to. The user can set the value.
250 |
251 | [SEE_ALSO]
252 | FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE
253 | FMOD_DSP_PARAMETER_FLOAT_MAPPING_PIECEWISE_LINEAR
254 | FMOD_DSP_PARAMETER_DESC_FLOAT
255 | ]
256 | */
257 | typedef struct FMOD_DSP_PARAMETER_FLOAT_MAPPING
258 | {
259 | FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE type;
260 | FMOD_DSP_PARAMETER_FLOAT_MAPPING_PIECEWISE_LINEAR piecewiselinearmapping; /* [w] Only required for FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE_PIECEWISE_LINEAR type mapping. */
261 | } FMOD_DSP_PARAMETER_FLOAT_MAPPING;
262 |
263 |
264 | /*
265 | [STRUCTURE]
266 | [
267 | [DESCRIPTION]
268 | Structure to define a float parameter for a DSP unit.
269 |
270 | [REMARKS]
271 | Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
272 | Members marked with [w] mean the variable can be written to. The user can set the value.
273 |
274 | [SEE_ALSO]
275 | System::createDSP
276 | DSP::setParameterFloat
277 | DSP::getParameterFloat
278 | FMOD_DSP_PARAMETER_DESC
279 | FMOD_DSP_PARAMETER_FLOAT_MAPPING
280 | ]
281 | */
282 | typedef struct FMOD_DSP_PARAMETER_DESC_FLOAT
283 | {
284 | float min; /* [w] Minimum parameter value. */
285 | float max; /* [w] Maximum parameter value. */
286 | float defaultval; /* [w] Default parameter value. */
287 | FMOD_DSP_PARAMETER_FLOAT_MAPPING mapping; /* [w] How the values are distributed across dials and automation curves (e.g. linearly, exponentially etc). */
288 | } FMOD_DSP_PARAMETER_DESC_FLOAT;
289 |
290 |
291 | /*
292 | [STRUCTURE]
293 | [
294 | [DESCRIPTION]
295 | Structure to define a int parameter for a DSP unit.
296 |
297 | [REMARKS]
298 | Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
299 | Members marked with [w] mean the variable can be written to. The user can set the value.
300 |
301 | [SEE_ALSO]
302 | System::createDSP
303 | DSP::setParameterInt
304 | DSP::getParameterInt
305 | FMOD_DSP_PARAMETER_DESC
306 | ]
307 | */
308 | typedef struct FMOD_DSP_PARAMETER_DESC_INT
309 | {
310 | int min; /* [w] Minimum parameter value. */
311 | int max; /* [w] Maximum parameter value. */
312 | int defaultval; /* [w] Default parameter value. */
313 | FMOD_BOOL goestoinf; /* [w] Whether the last value represents infiniy. */
314 | const char* const* valuenames; /* [w] Names for each value. There should be as many strings as there are possible values (max - min + 1). Optional. */
315 | } FMOD_DSP_PARAMETER_DESC_INT;
316 |
317 |
318 | /*
319 | [STRUCTURE]
320 | [
321 | [DESCRIPTION]
322 | Structure to define a boolean parameter for a DSP unit.
323 |
324 | [REMARKS]
325 | Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
326 | Members marked with [w] mean the variable can be written to. The user can set the value.
327 |
328 | [SEE_ALSO]
329 | System::createDSP
330 | DSP::setParameterBool
331 | DSP::getParameterBool
332 | FMOD_DSP_PARAMETER_DESC
333 | ]
334 | */
335 | typedef struct FMOD_DSP_PARAMETER_DESC_BOOL
336 | {
337 | FMOD_BOOL defaultval; /* [w] Default parameter value. */
338 | const char* const* valuenames; /* [w] Names for false and true, respectively. There should be two strings. Optional. */
339 | } FMOD_DSP_PARAMETER_DESC_BOOL;
340 |
341 |
342 | /*
343 | [STRUCTURE]
344 | [
345 | [DESCRIPTION]
346 | Structure to define a data parameter for a DSP unit. Use 0 or above for custom types. This parameter will be treated specially by the system if set to one of the FMOD_DSP_PARAMETER_DATA_TYPE values.
347 |
348 | [REMARKS]
349 | Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
350 | Members marked with [w] mean the variable can be written to. The user can set the value.
351 |
352 | [SEE_ALSO]
353 | System::createDSP
354 | DSP::setParameterData
355 | DSP::getParameterData
356 | FMOD_DSP_PARAMETER_DATA_TYPE
357 | FMOD_DSP_PARAMETER_DESC
358 | ]
359 | */
360 | typedef struct FMOD_DSP_PARAMETER_DESC_DATA
361 | {
362 | int datatype; /* [w] The type of data for this parameter. Use 0 or above for custom types or set to one of the FMOD_DSP_PARAMETER_DATA_TYPE values. */
363 | } FMOD_DSP_PARAMETER_DESC_DATA;
364 |
365 |
366 | /*
367 | [STRUCTURE]
368 | [
369 | [DESCRIPTION]
370 | Base Structure for DSP parameter descriptions.
371 |
372 | [REMARKS]
373 | Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
374 | Members marked with [w] mean the variable can be written to. The user can set the value.
375 |
376 | [SEE_ALSO]
377 | System::createDSP
378 | DSP::setParameterFloat
379 | DSP::getParameterFloat
380 | DSP::setParameterInt
381 | DSP::getParameterInt
382 | DSP::setParameterBool
383 | DSP::getParameterBool
384 | DSP::setParameterData
385 | DSP::getParameterData
386 | FMOD_DSP_PARAMETER_DESC_FLOAT
387 | FMOD_DSP_PARAMETER_DESC_INT
388 | FMOD_DSP_PARAMETER_DESC_BOOL
389 | FMOD_DSP_PARAMETER_DESC_DATA
390 | ]
391 | */
392 | typedef struct FMOD_DSP_PARAMETER_DESC
393 | {
394 | FMOD_DSP_PARAMETER_TYPE type; /* [w] Type of this parameter. */
395 | char name[16]; /* [w] Name of the parameter to be displayed (ie "Cutoff frequency"). */
396 | char label[16]; /* [w] Short string to be put next to value to denote the unit type (ie "hz"). */
397 | const char *description; /* [w] Description of the parameter to be displayed as a help item / tooltip for this parameter. */
398 |
399 | union
400 | {
401 | FMOD_DSP_PARAMETER_DESC_FLOAT floatdesc; /* [w] Struct containing information about the parameter in floating point format. Use when type is FMOD_DSP_PARAMETER_TYPE_FLOAT. */
402 | FMOD_DSP_PARAMETER_DESC_INT intdesc; /* [w] Struct containing information about the parameter in integer format. Use when type is FMOD_DSP_PARAMETER_TYPE_INT. */
403 | FMOD_DSP_PARAMETER_DESC_BOOL booldesc; /* [w] Struct containing information about the parameter in boolean format. Use when type is FMOD_DSP_PARAMETER_TYPE_BOOL. */
404 | FMOD_DSP_PARAMETER_DESC_DATA datadesc; /* [w] Struct containing information about the parameter in data format. Use when type is FMOD_DSP_PARAMETER_TYPE_DATA. */
405 | };
406 | } FMOD_DSP_PARAMETER_DESC;
407 |
408 |
409 | /*
410 | [ENUM]
411 | [
412 | [DESCRIPTION]
413 | Built-in types for the 'datatype' member of FMOD_DSP_PARAMETER_DESC_DATA. Data parameters of type other than FMOD_DSP_PARAMETER_DATA_TYPE_USER will be treated specially by the system.
414 |
415 | [REMARKS]
416 |
417 | [SEE_ALSO]
418 | FMOD_DSP_PARAMETER_DESC_DATA
419 | FMOD_DSP_PARAMETER_OVERALLGAIN
420 | FMOD_DSP_PARAMETER_3DATTRIBUTES
421 | FMOD_DSP_PARAMETER_3DATTRIBUTES_MULTI
422 | FMOD_DSP_PARAMETER_SIDECHAIN
423 | ]
424 | */
425 | typedef enum
426 | {
427 | FMOD_DSP_PARAMETER_DATA_TYPE_USER = 0, /* The default data type. All user data types should be 0 or above. */
428 | FMOD_DSP_PARAMETER_DATA_TYPE_OVERALLGAIN = -1, /* The data type for FMOD_DSP_PARAMETER_OVERALLGAIN parameters. There should a maximum of one per DSP. */
429 | FMOD_DSP_PARAMETER_DATA_TYPE_3DATTRIBUTES = -2, /* The data type for FMOD_DSP_PARAMETER_3DATTRIBUTES parameters. There should a maximum of one per DSP. */
430 | FMOD_DSP_PARAMETER_DATA_TYPE_SIDECHAIN = -3, /* The data type for FMOD_DSP_PARAMETER_SIDECHAIN parameters. There should a maximum of one per DSP. */
431 | FMOD_DSP_PARAMETER_DATA_TYPE_FFT = -4, /* The data type for FMOD_DSP_PARAMETER_FFT parameters. There should a maximum of one per DSP. */
432 | FMOD_DSP_PARAMETER_DATA_TYPE_3DATTRIBUTES_MULTI = -5, /* The data type for FMOD_DSP_PARAMETER_3DATTRIBUTES_MULTI parameters. There should a maximum of one per DSP. */
433 | } FMOD_DSP_PARAMETER_DATA_TYPE;
434 |
435 |
436 | /*
437 | [STRUCTURE]
438 | [
439 | [DESCRIPTION]
440 | Structure for data parameters of type FMOD_DSP_PARAMETER_DATA_TYPE_OVERALLGAIN.
441 | A parameter of this type is used in effects that affect the overgain of the signal in a predictable way.
442 | This parameter is read by the system to determine the effect's gain for voice virtualization.
443 |
444 | [REMARKS]
445 | Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
446 | Members marked with [w] mean the variable can be written to. The user can set the value.
447 |
448 | [SEE_ALSO]
449 | FMOD_DSP_PARAMETER_DATA_TYPE
450 | FMOD_DSP_PARAMETER_DESC
451 | ]
452 | */
453 | typedef struct FMOD_DSP_PARAMETER_OVERALLGAIN
454 | {
455 | float linear_gain; /* [r] The overall linear gain of the effect on the direct signal path */
456 | float linear_gain_additive; /* [r] Additive gain, for parallel signal paths */
457 | } FMOD_DSP_PARAMETER_OVERALLGAIN;
458 |
459 |
460 | /*
461 | [STRUCTURE]
462 | [
463 | [DESCRIPTION]
464 | Structure for data parameters of type FMOD_DSP_PARAMETER_DATA_TYPE_3DATTRIBUTES.
465 | A parameter of this type is used in effects that respond to a sound's 3D position.
466 | The system will set this parameter automatically if a sound's position changes.
467 |
468 | [REMARKS]
469 | Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
470 | Members marked with [w] mean the variable can be written to. The user can set the value.
471 |
472 | [SEE_ALSO]
473 | FMOD_DSP_PARAMETER_DATA_TYPE
474 | FMOD_DSP_PARAMETER_DESC
475 | ]
476 | */
477 | typedef struct FMOD_DSP_PARAMETER_3DATTRIBUTES
478 | {
479 | FMOD_3D_ATTRIBUTES relative; /* [w] The position of the sound relative to the listener. */
480 | FMOD_3D_ATTRIBUTES absolute; /* [w] The position of the sound in world coordinates. */
481 | } FMOD_DSP_PARAMETER_3DATTRIBUTES;
482 |
483 |
484 | /*
485 | [STRUCTURE]
486 | [
487 | [DESCRIPTION]
488 | Structure for data parameters of type FMOD_DSP_PARAMETER_DATA_TYPE_3DATTRIBUTES_MULTI.
489 | A parameter of this type is used in effects that respond to a sound's 3D position, and support multiple listeners.
490 | The system will set this parameter automatically if a sound's position changes.
491 |
492 | [REMARKS]
493 | Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
494 | Members marked with [w] mean the variable can be written to. The user can set the value.
495 |
496 | [SEE_ALSO]
497 | FMOD_DSP_PARAMETER_DATA_TYPE
498 | FMOD_DSP_PARAMETER_DESC
499 | ]
500 | */
501 | typedef struct FMOD_DSP_PARAMETER_3DATTRIBUTES_MULTI
502 | {
503 | int numlisteners; /* [w] The number of listeners. */
504 | FMOD_3D_ATTRIBUTES relative[FMOD_MAX_LISTENERS]; /* [w] The position of the sound relative to the listeners. */
505 | FMOD_3D_ATTRIBUTES absolute; /* [w] The position of the sound in world coordinates. */
506 | } FMOD_DSP_PARAMETER_3DATTRIBUTES_MULTI;
507 |
508 |
509 | /*
510 | [STRUCTURE]
511 | [
512 | [DESCRIPTION]
513 | Structure for data parameters of type FMOD_DSP_PARAMETER_DATA_TYPE_SIDECHAIN.
514 | A parameter of this type is declared for effects which support sidechaining.
515 |
516 | [REMARKS]
517 | Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
518 | Members marked with [w] mean the variable can be written to. The user can set the value.
519 |
520 | [SEE_ALSO]
521 | FMOD_DSP_PARAMETER_DATA_TYPE
522 | FMOD_DSP_PARAMETER_DESC
523 | ]
524 | */
525 | typedef struct FMOD_DSP_PARAMETER_SIDECHAIN
526 | {
527 | FMOD_BOOL sidechainenable; /* [r/w] Whether sidechains are enabled. */
528 | } FMOD_DSP_PARAMETER_SIDECHAIN;
529 |
530 |
531 | /*
532 | [STRUCTURE]
533 | [
534 | [DESCRIPTION]
535 | Structure for data parameters of type FMOD_DSP_PARAMETER_DATA_TYPE_FFT.
536 | A parameter of this type is declared for the FMOD_DSP_TYPE_FFT effect.
537 |
538 | [REMARKS]
539 | Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
540 | Members marked with [w] mean the variable can be written to. The user can set the value.
541 |
542 | Notes on the spectrum data member. Values inside the float buffer are typically between 0 and 1.0.
543 | Each top level array represents one PCM channel of data.
544 | Address data as spectrum[channel][bin]. A bin is 1 fft window entry.
545 | Only read/display half of the buffer typically for analysis as the 2nd half is usually the same data reversed due to the nature of the way FFT works.
546 |
547 | [SEE_ALSO]
548 | FMOD_DSP_PARAMETER_DATA_TYPE
549 | FMOD_DSP_PARAMETER_DESC
550 | FMOD_DSP_PARAMETER_DATA_TYPE_FFT
551 | FMOD_DSP_TYPE
552 | FMOD_DSP_FFT
553 | ]
554 | */
555 | typedef struct FMOD_DSP_PARAMETER_FFT
556 | {
557 | int length; /* [r] Number of entries in this spectrum window. Divide this by the output rate to get the hz per entry. */
558 | int numchannels; /* [r] Number of channels in spectrum. */
559 | float *spectrum[32]; /* [r] Per channel spectrum arrays. See remarks for more. */
560 | } FMOD_DSP_PARAMETER_FFT;
561 |
562 |
563 | /*
564 | Helpers for declaring parameters in custom DSPSs
565 | */
566 | #define FMOD_DSP_INIT_PARAMDESC_FLOAT(_paramstruct, _name, _label, _description, _min, _max, _defaultval) \
567 | memset(&(_paramstruct), 0, sizeof(_paramstruct)); \
568 | (_paramstruct).type = FMOD_DSP_PARAMETER_TYPE_FLOAT; \
569 | strncpy((_paramstruct).name, _name, 15); \
570 | strncpy((_paramstruct).label, _label, 15); \
571 | (_paramstruct).description = _description; \
572 | (_paramstruct).floatdesc.min = _min; \
573 | (_paramstruct).floatdesc.max = _max; \
574 | (_paramstruct).floatdesc.defaultval = _defaultval; \
575 | (_paramstruct).floatdesc.mapping.type = FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE_AUTO;
576 |
577 | #define FMOD_DSP_INIT_PARAMDESC_FLOAT_WITH_MAPPING(_paramstruct, _name, _label, _description, _defaultval, _values, _positions); \
578 | memset(&(_paramstruct), 0, sizeof(_paramstruct)); \
579 | (_paramstruct).type = FMOD_DSP_PARAMETER_TYPE_FLOAT; \
580 | strncpy((_paramstruct).name, _name , 15); \
581 | strncpy((_paramstruct).label, _label, 15); \
582 | (_paramstruct).description = _description; \
583 | (_paramstruct).floatdesc.min = _values[0]; \
584 | (_paramstruct).floatdesc.max = _values[sizeof(_values) / sizeof(float) - 1]; \
585 | (_paramstruct).floatdesc.defaultval = _defaultval; \
586 | (_paramstruct).floatdesc.mapping.type = FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE_PIECEWISE_LINEAR; \
587 | (_paramstruct).floatdesc.mapping.piecewiselinearmapping.numpoints = sizeof(_values) / sizeof(float); \
588 | (_paramstruct).floatdesc.mapping.piecewiselinearmapping.pointparamvalues = _values; \
589 | (_paramstruct).floatdesc.mapping.piecewiselinearmapping.pointpositions = _positions;
590 |
591 | #define FMOD_DSP_INIT_PARAMDESC_INT(_paramstruct, _name, _label, _description, _min, _max, _defaultval, _goestoinf, _valuenames) \
592 | memset(&(_paramstruct), 0, sizeof(_paramstruct)); \
593 | (_paramstruct).type = FMOD_DSP_PARAMETER_TYPE_INT; \
594 | strncpy((_paramstruct).name, _name , 15); \
595 | strncpy((_paramstruct).label, _label, 15); \
596 | (_paramstruct).description = _description; \
597 | (_paramstruct).intdesc.min = _min; \
598 | (_paramstruct).intdesc.max = _max; \
599 | (_paramstruct).intdesc.defaultval = _defaultval; \
600 | (_paramstruct).intdesc.goestoinf = _goestoinf; \
601 | (_paramstruct).intdesc.valuenames = _valuenames;
602 |
603 | #define FMOD_DSP_INIT_PARAMDESC_INT_ENUMERATED(_paramstruct, _name, _label, _description, _defaultval, _valuenames) \
604 | memset(&(_paramstruct), 0, sizeof(_paramstruct)); \
605 | (_paramstruct).type = FMOD_DSP_PARAMETER_TYPE_INT; \
606 | strncpy((_paramstruct).name, _name , 15); \
607 | strncpy((_paramstruct).label, _label, 15); \
608 | (_paramstruct).description = _description; \
609 | (_paramstruct).intdesc.min = 0; \
610 | (_paramstruct).intdesc.max = sizeof(_valuenames) / sizeof(char*) - 1; \
611 | (_paramstruct).intdesc.defaultval = _defaultval; \
612 | (_paramstruct).intdesc.goestoinf = false; \
613 | (_paramstruct).intdesc.valuenames = _valuenames;
614 |
615 | #define FMOD_DSP_INIT_PARAMDESC_BOOL(_paramstruct, _name, _label, _description, _defaultval, _valuenames) \
616 | memset(&(_paramstruct), 0, sizeof(_paramstruct)); \
617 | (_paramstruct).type = FMOD_DSP_PARAMETER_TYPE_BOOL; \
618 | strncpy((_paramstruct).name, _name , 15); \
619 | strncpy((_paramstruct).label, _label, 15); \
620 | (_paramstruct).description = _description; \
621 | (_paramstruct).booldesc.defaultval = _defaultval; \
622 | (_paramstruct).booldesc.valuenames = _valuenames;
623 |
624 | #define FMOD_DSP_INIT_PARAMDESC_DATA(_paramstruct, _name, _label, _description, _datatype) \
625 | memset(&(_paramstruct), 0, sizeof(_paramstruct)); \
626 | (_paramstruct).type = FMOD_DSP_PARAMETER_TYPE_DATA; \
627 | strncpy((_paramstruct).name, _name , 15); \
628 | strncpy((_paramstruct).label, _label, 15); \
629 | (_paramstruct).description = _description; \
630 | (_paramstruct).datadesc.datatype = _datatype;
631 |
632 | #define FMOD_PLUGIN_SDK_VERSION 108
633 |
634 | /*
635 | [STRUCTURE]
636 | [
637 | [DESCRIPTION]
638 | When creating a DSP unit, declare one of these and provide the relevant callbacks and name for FMOD to use when it creates and uses a DSP unit of this type.
639 |
640 | [REMARKS]
641 | Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
642 | Members marked with [w] mean the variable can be written to. The user can set the value.
643 |
644 | There are 2 different ways to change a parameter in this architecture.
645 | One is to use DSP::setParameterFloat / DSP::setParameterInt / DSP::setParameterBool / DSP::setParameterData. This is platform independant and is dynamic, so new unknown plugins can have their parameters enumerated and used.
646 | The other is to use DSP::showConfigDialog. This is platform specific and requires a GUI, and will display a dialog box to configure the plugin.
647 |
648 | [SEE_ALSO]
649 | System::createDSP
650 | DSP::setParameterFloat
651 | DSP::setParameterInt
652 | DSP::setParameterBool
653 | DSP::setParameterData
654 | FMOD_DSP_STATE
655 | FMOD_DSP_CREATE_CALLBACK
656 | FMOD_DSP_RELEASE_CALLBACK
657 | FMOD_DSP_RESET_CALLBACK
658 | FMOD_DSP_READ_CALLBACK
659 | FMOD_DSP_PROCESS_CALLBACK
660 | FMOD_DSP_SETPOSITION_CALLBACK
661 | FMOD_DSP_PARAMETER_DESC
662 | FMOD_DSP_SETPARAM_FLOAT_CALLBACK
663 | FMOD_DSP_SETPARAM_INT_CALLBACK
664 | FMOD_DSP_SETPARAM_BOOL_CALLBACK
665 | FMOD_DSP_SETPARAM_DATA_CALLBACK
666 | FMOD_DSP_GETPARAM_FLOAT_CALLBACK
667 | FMOD_DSP_GETPARAM_INT_CALLBACK
668 | FMOD_DSP_GETPARAM_BOOL_CALLBACK
669 | FMOD_DSP_GETPARAM_DATA_CALLBACK
670 | FMOD_DSP_SHOULDIPROCESS_CALLBACK
671 | FMOD_DSP_SYSTEM_REGISTER_CALLBACK
672 | FMOD_DSP_SYSTEM_DEREGISTER_CALLBACK
673 | FMOD_DSP_SYSTEM_MIX_CALLBACK
674 | ]
675 | */
676 | typedef struct FMOD_DSP_DESCRIPTION
677 | {
678 | unsigned int pluginsdkversion; /* [w] The plugin SDK version this plugin is built for. set to this to FMOD_PLUGIN_SDK_VERSION defined above. */
679 | char name[32]; /* [w] The identifier of the DSP. This will also be used as the name of DSP and shouldn't change between versions. */
680 | unsigned int version; /* [w] Plugin writer's version number. */
681 | int numinputbuffers; /* [w] Number of input buffers to process. Use 0 for DSPs that only generate sound and 1 for effects that process incoming sound. */
682 | int numoutputbuffers; /* [w] Number of audio output buffers. Only one output buffer is currently supported. */
683 | FMOD_DSP_CREATE_CALLBACK create; /* [w] Create callback. This is called when DSP unit is created. Can be null. */
684 | FMOD_DSP_RELEASE_CALLBACK release; /* [w] Release callback. This is called just before the unit is freed so the user can do any cleanup needed for the unit. Can be null. */
685 | FMOD_DSP_RESET_CALLBACK reset; /* [w] Reset callback. This is called by the user to reset any history buffers that may need resetting for a filter, when it is to be used or re-used for the first time to its initial clean state. Use to avoid clicks or artifacts. */
686 | FMOD_DSP_READ_CALLBACK read; /* [w] Read callback. Processing is done here. Can be null. */
687 | FMOD_DSP_PROCESS_CALLBACK process; /* [w] Process callback. Can be specified instead of the read callback if any channel format changes occur between input and output. This also replaces shouldiprocess and should return an error if the effect is to be bypassed. Can be null. */
688 | FMOD_DSP_SETPOSITION_CALLBACK setposition; /* [w] Set position callback. This is called if the unit wants to update its position info but not process data, or reset a cursor position internally if it is reading data from a certain source. Can be null. */
689 |
690 | int numparameters; /* [w] Number of parameters used in this filter. The user finds this with DSP::getNumParameters */
691 | FMOD_DSP_PARAMETER_DESC **paramdesc; /* [w] Variable number of parameter structures. */
692 | FMOD_DSP_SETPARAM_FLOAT_CALLBACK setparameterfloat; /* [w] This is called when the user calls DSP::setParameterFloat. Can be null. */
693 | FMOD_DSP_SETPARAM_INT_CALLBACK setparameterint; /* [w] This is called when the user calls DSP::setParameterInt. Can be null. */
694 | FMOD_DSP_SETPARAM_BOOL_CALLBACK setparameterbool; /* [w] This is called when the user calls DSP::setParameterBool. Can be null. */
695 | FMOD_DSP_SETPARAM_DATA_CALLBACK setparameterdata; /* [w] This is called when the user calls DSP::setParameterData. Can be null. */
696 | FMOD_DSP_GETPARAM_FLOAT_CALLBACK getparameterfloat; /* [w] This is called when the user calls DSP::getParameterFloat. Can be null. */
697 | FMOD_DSP_GETPARAM_INT_CALLBACK getparameterint; /* [w] This is called when the user calls DSP::getParameterInt. Can be null. */
698 | FMOD_DSP_GETPARAM_BOOL_CALLBACK getparameterbool; /* [w] This is called when the user calls DSP::getParameterBool. Can be null. */
699 | FMOD_DSP_GETPARAM_DATA_CALLBACK getparameterdata; /* [w] This is called when the user calls DSP::getParameterData. Can be null. */
700 | FMOD_DSP_SHOULDIPROCESS_CALLBACK shouldiprocess; /* [w] This is called before processing. You can detect if inputs are idle and return FMOD_OK to process, or any other error code to avoid processing the effect. Use a count down timer to allow effect tails to process before idling! */
701 | void *userdata; /* [w] Optional. Specify 0 to ignore. This is user data to be attached to the DSP unit during creation. Access via DSP::getUserData. */
702 |
703 | FMOD_DSP_SYSTEM_REGISTER_CALLBACK sys_register; /* [w] Register callback. This is called when DSP unit is loaded/registered. Useful for 'global'/per system object init for plugin. Can be null. */
704 | FMOD_DSP_SYSTEM_DEREGISTER_CALLBACK sys_deregister; /* [w] Deregister callback. This is called when DSP unit is unloaded/deregistered. Useful as 'global'/per system object shutdown for plugin. Can be null. */
705 | FMOD_DSP_SYSTEM_MIX_CALLBACK sys_mix; /* [w] System mix stage callback. This is called when the mixer starts to execute or is just finishing executing. Useful for 'global'/per system object once a mix update calls for a plugin. Can be null. */
706 |
707 | } FMOD_DSP_DESCRIPTION;
708 |
709 |
710 | /*
711 | [STRUCTURE]
712 | [
713 | [DESCRIPTION]
714 | Struct containing DFT callbacks for plugins, to enable a plugin to perform optimized time-frequency domain conversion.
715 |
716 | [REMARKS]
717 | Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
718 | Members marked with [w] mean the variable can be written to. The user can set the value.
719 |
720 | [SEE_ALSO]
721 | FMOD_DSP_STATE_SYSTEMCALLBACKS
722 | ]
723 | */
724 | typedef struct FMOD_DSP_STATE_DFTCALLBACKS
725 | {
726 | FMOD_DSP_DFT_FFTREAL fftreal; /* [r] Callback for performing an FFT on a real signal. */
727 | FMOD_DSP_DFT_IFFTREAL inversefftreal; /* [r] Callback for performing an inverse FFT to get a real signal. */
728 | } FMOD_DSP_STATE_DFTCALLBACKS;
729 |
730 | /*
731 | [STRUCTURE]
732 | [
733 | [DESCRIPTION]
734 | Struct containing panning helper callbacks for plugins.
735 |
736 | [REMARKS]
737 | These are experimental, please contact support@fmod.org for more information.
738 |
739 | [SEE_ALSO]
740 | FMOD_DSP_STATE_SYSTEMCALLBACKS
741 | FMOD_DSP_PAN_SURROUND_FLAGS
742 | ]
743 | */
744 | typedef struct FMOD_DSP_STATE_PAN_CALLBACKS
745 | {
746 | FMOD_DSP_PAN_SUM_MONO_MATRIX summonomatrix;
747 | FMOD_DSP_PAN_SUM_STEREO_MATRIX sumstereomatrix;
748 | FMOD_DSP_PAN_SUM_SURROUND_MATRIX sumsurroundmatrix;
749 | FMOD_DSP_PAN_SUM_MONO_TO_SURROUND_MATRIX summonotosurroundmatrix;
750 | FMOD_DSP_PAN_SUM_STEREO_TO_SURROUND_MATRIX sumstereotosurroundmatrix;
751 | FMOD_DSP_PAN_3D_GET_ROLLOFF_GAIN getrolloffgain;
752 | } FMOD_DSP_STATE_PAN_CALLBACKS;
753 |
754 | /*
755 | [STRUCTURE]
756 | [
757 | [DESCRIPTION]
758 | Struct containing System level callbacks for plugins, to enable a plugin to query information about the system or allocate memory using FMOD's (and therefore possibly the game's) allocators.
759 |
760 | [REMARKS]
761 | Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
762 | Members marked with [w] mean the variable can be written to. The user can set the value.
763 |
764 | [SEE_ALSO]
765 | FMOD_DSP_STATE
766 | FMOD_DSP_STATE_DFTCALLBACKS
767 | FMOD_DSP_STATE_PAN_CALLBACKS
768 | ]
769 | */
770 | typedef struct FMOD_DSP_STATE_SYSTEMCALLBACKS
771 | {
772 | FMOD_MEMORY_ALLOC_CALLBACK alloc; /* [r] Memory allocation callback. Use this for all dynamic memory allocation within the plugin. */
773 | FMOD_MEMORY_REALLOC_CALLBACK realloc; /* [r] Memory reallocation callback. */
774 | FMOD_MEMORY_FREE_CALLBACK free; /* [r] Memory free callback. */
775 | FMOD_DSP_SYSTEM_GETSAMPLERATE getsamplerate; /* [r] Callback for getting the system samplerate. */
776 | FMOD_DSP_SYSTEM_GETBLOCKSIZE getblocksize; /* [r] Callback for getting the system's block size. DSPs will be requested to process blocks of varying length up to this size.*/
777 | FMOD_DSP_STATE_DFTCALLBACKS *dft; /* [r] Struct containing callbacks for performing FFTs and inverse FFTs. */
778 | FMOD_DSP_STATE_PAN_CALLBACKS *pancallbacks; /* [r] Pointer to a structure of callbacks for calculating pan, up-mix and down-mix matrices. */
779 | FMOD_DSP_SYSTEM_GETSPEAKERMODE getspeakermode; /* [r] Callback for getting the system's speaker modes. One is the mixer's default speaker mode, the other is the output mode the system is downmixing or upmixing to.*/
780 | FMOD_DSP_STATE_GETCLOCK getclock; /* [r] Callback for getting the clock of the current DSP, as well as the subset of the input buffer that contains the signal */
781 | } FMOD_DSP_STATE_SYSTEMCALLBACKS;
782 |
783 |
784 | /*
785 | [STRUCTURE]
786 | [
787 | [DESCRIPTION]
788 | DSP plugin structure that is passed into each callback.
789 |
790 | [REMARKS]
791 | Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
792 | Members marked with [w] mean the variable can be written to. The user can set the value.
793 |
794 | 'systemobject' is an integer that relates to the System object that created the DSP or registered the DSP plugin. If only 1 System object is created then it should be 0. A second object would be 1 and so on.
795 | FMOD_DSP_STATE_SYSTEMCALLBACKS::getsamplerate/getblocksize/getspeakermode could return different results so it could be relevant to plugin developers to monitor which object is being used.
796 |
797 | [SEE_ALSO]
798 | FMOD_DSP_DESCRIPTION
799 | FMOD_DSP_STATE_SYSTEMCALLBACKS
800 | ]
801 | */
802 | struct FMOD_DSP_STATE
803 | {
804 | FMOD_DSP *instance; /* [r] Handle to the FMOD_DSP object the callback is associated with. Not to be modified. C++ users cast to FMOD::DSP to use. */
805 | void *plugindata; /* [r/w] Plugin writer created data the output author wants to attach to this object. */
806 | FMOD_CHANNELMASK channelmask; /* [r] Specifies which speakers the DSP effect is active on */
807 | FMOD_SPEAKERMODE source_speakermode; /* [r] Specifies which speaker mode the signal originated for information purposes, ie in case panning needs to be done differently. */
808 | float *sidechaindata; /* [r] The mixed result of all incoming sidechains is stored at this pointer address. */
809 | int sidechainchannels; /* [r] The number of channels of pcm data stored within the sidechain buffer. */
810 | FMOD_DSP_STATE_SYSTEMCALLBACKS *callbacks; /* [r] Struct containing callbacks for system level functionality. */
811 | int systemobject; /* [r] FMOD::System object index, relating to the System object that created this DSP. */
812 | };
813 |
814 |
815 | /*
816 | Macro helpers for accessing FMOD_DSP_STATE_SYSTEMCALLBACKS
817 | */
818 | #define FMOD_DSP_STATE_MEMALLOC(_state, _size, _type, _str) (_state)->callbacks->alloc (_size, _type, _str); /* Pass in the FMOD_DSP_STATE handle, size in bytes to alloc, FMOD_MEMORY_TYPE type and optional char * string to identify where the alloc came from. */
819 | #define FMOD_DSP_STATE_MEMREALLOC(_state, _ptr, _size, _type, _str) (_state)->callbacks->realloc (_ptr, _size, _type, _str); /* Pass in the FMOD_DSP_STATE handle, optional existing memory pointer, size in bytes to alloc, FMOD_MEMORY_TYPE type and optional char * string to identify where the alloc came from. */
820 | #define FMOD_DSP_STATE_MEMFREE(_state, _ptr, _type, _str) (_state)->callbacks->free (_ptr, _type, _str); /* Pass in the FMOD_DSP_STATE handle, existing memory pointer, FMOD_MEMORY_TYPE type and optional char * string to identify where the free came from. */
821 | #define FMOD_DSP_STATE_GETSAMPLERATE(_state, _rate) (_state)->callbacks->getsamplerate (_state, _rate); /* Pass in the FMOD_DSP_STATE handle, and the address of an int to receive the system DSP sample rate. */
822 | #define FMOD_DSP_STATE_GETBLOCKSIZE(_state, _blocksize) (_state)->callbacks->getblocksize (_state, _blocksize); /* Pass in the FMOD_DSP_STATE handle, and the address of an unsigned int to receive the system DSP block size. */
823 | #define FMOD_DSP_STATE_GETSPEAKERMODE(_state, _speakermode_mix, _speakermode_out) (_state)->callbacks->getspeakermode(_state, _speakermode_mix, _speakermode_out); /* Pass in the FMOD_DSP_STATE handle, and the address of an unsigned int to receive the FMOD_SPEAKERMODE for the mixer, and for the mode the system is set to. */
824 | #define FMOD_DSP_STATE_FFTREAL(_state, _size, _signal, _dft, _window, _signalhop) (_state)->callbacks->dft->fftreal (_state, _size, _signal, _dft, _window, _signalhop); /* Pass in the FMOD_DSP_STATE handle, size of the signal and its DFT, a float buffer containing the signal and an FMOD_COMPLEX buffer to store the calculated DFT. */
825 | #define FMOD_DSP_STATE_IFFTREAL(_state, _size, _dft, _signal, _window, _signalhop) (_state)->callbacks->dft->inversefftreal(_state, _size, _dft, _signal, _window, _signalhop); /* Pass in the FMOD_DSP_STATE handle, size of the DFT and its signal, an FMOD_COMPLEX buffer containing the DFT and a float buffer to store the calculated signal. */
826 |
827 |
828 | /*
829 | [STRUCTURE]
830 | [
831 | [DESCRIPTION]
832 | DSP metering info used for retrieving metering info with DSP::getMeteringInfo
833 |
834 | [REMARKS]
835 | Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
836 | Members marked with [w] mean the variable can be written to. The user can set the value.
837 |
838 | [SEE_ALSO]
839 | FMOD_SPEAKER
840 | DSP::getMeteringInfo
841 | ]
842 | */
843 | typedef struct FMOD_DSP_METERING_INFO
844 | {
845 | int numsamples; /* [r] The number of samples considered for this metering info. */
846 | float peaklevel[32]; /* [r] The peak level per channel. */
847 | float rmslevel[32]; /* [r] The rms level per channel. */
848 | short numchannels; /* [r] Number of channels. */
849 | } FMOD_DSP_METERING_INFO;
850 |
851 | #endif
852 |
853 |
--------------------------------------------------------------------------------
/jni/inc/fmod.h:
--------------------------------------------------------------------------------
1 | /*$ preserve start $*/
2 |
3 | /* ======================================================================================== */
4 | /* FMOD Studio Low Level API - C header file. */
5 | /* Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016. */
6 | /* */
7 | /* Use this header in conjunction with fmod_common.h (which contains all the constants / */
8 | /* callbacks) to develop using C interface. */
9 | /* ======================================================================================== */
10 |
11 | #ifndef _FMOD_H
12 | #define _FMOD_H
13 |
14 | #include "fmod_common.h"
15 |
16 | /* ========================================================================================== */
17 | /* FUNCTION PROTOTYPES */
18 | /* ========================================================================================== */
19 |
20 | #ifdef __cplusplus
21 | extern "C"
22 | {
23 | #endif
24 |
25 | /*
26 | FMOD global system functions (optional).
27 | */
28 |
29 | FMOD_RESULT F_API FMOD_Memory_Initialize (void *poolmem, int poollen, FMOD_MEMORY_ALLOC_CALLBACK useralloc, FMOD_MEMORY_REALLOC_CALLBACK userrealloc, FMOD_MEMORY_FREE_CALLBACK userfree, FMOD_MEMORY_TYPE memtypeflags);
30 | FMOD_RESULT F_API FMOD_Memory_GetStats (int *currentalloced, int *maxalloced, FMOD_BOOL blocking);
31 | FMOD_RESULT F_API FMOD_Debug_Initialize (FMOD_DEBUG_FLAGS flags, FMOD_DEBUG_MODE mode, FMOD_DEBUG_CALLBACK callback, const char *filename);
32 | FMOD_RESULT F_API FMOD_File_SetDiskBusy (int busy);
33 | FMOD_RESULT F_API FMOD_File_GetDiskBusy (int *busy);
34 |
35 | /*
36 | FMOD System factory functions. Use this to create an FMOD System Instance. below you will see FMOD_System_Init/Close to get started.
37 | */
38 |
39 | FMOD_RESULT F_API FMOD_System_Create (FMOD_SYSTEM **system);
40 | FMOD_RESULT F_API FMOD_System_Release (FMOD_SYSTEM *system);
41 |
42 | /*$ preserve end $*/
43 |
44 | /*
45 | 'System' API
46 | */
47 |
48 | /*
49 | Setup functions.
50 | */
51 |
52 | FMOD_RESULT F_API FMOD_System_SetOutput (FMOD_SYSTEM *system, FMOD_OUTPUTTYPE output);
53 | FMOD_RESULT F_API FMOD_System_GetOutput (FMOD_SYSTEM *system, FMOD_OUTPUTTYPE *output);
54 | FMOD_RESULT F_API FMOD_System_GetNumDrivers (FMOD_SYSTEM *system, int *numdrivers);
55 | FMOD_RESULT F_API FMOD_System_GetDriverInfo (FMOD_SYSTEM *system, int id, char *name, int namelen, FMOD_GUID *guid, int *systemrate, FMOD_SPEAKERMODE *speakermode, int *speakermodechannels);
56 | FMOD_RESULT F_API FMOD_System_SetDriver (FMOD_SYSTEM *system, int driver);
57 | FMOD_RESULT F_API FMOD_System_GetDriver (FMOD_SYSTEM *system, int *driver);
58 | FMOD_RESULT F_API FMOD_System_SetSoftwareChannels (FMOD_SYSTEM *system, int numsoftwarechannels);
59 | FMOD_RESULT F_API FMOD_System_GetSoftwareChannels (FMOD_SYSTEM *system, int *numsoftwarechannels);
60 | FMOD_RESULT F_API FMOD_System_SetSoftwareFormat (FMOD_SYSTEM *system, int samplerate, FMOD_SPEAKERMODE speakermode, int numrawspeakers);
61 | FMOD_RESULT F_API FMOD_System_GetSoftwareFormat (FMOD_SYSTEM *system, int *samplerate, FMOD_SPEAKERMODE *speakermode, int *numrawspeakers);
62 | FMOD_RESULT F_API FMOD_System_SetDSPBufferSize (FMOD_SYSTEM *system, unsigned int bufferlength, int numbuffers);
63 | FMOD_RESULT F_API FMOD_System_GetDSPBufferSize (FMOD_SYSTEM *system, unsigned int *bufferlength, int *numbuffers);
64 | FMOD_RESULT F_API FMOD_System_SetFileSystem (FMOD_SYSTEM *system, FMOD_FILE_OPEN_CALLBACK useropen, FMOD_FILE_CLOSE_CALLBACK userclose, FMOD_FILE_READ_CALLBACK userread, FMOD_FILE_SEEK_CALLBACK userseek, FMOD_FILE_ASYNCREAD_CALLBACK userasyncread, FMOD_FILE_ASYNCCANCEL_CALLBACK userasynccancel, int blockalign);
65 | FMOD_RESULT F_API FMOD_System_AttachFileSystem (FMOD_SYSTEM *system, FMOD_FILE_OPEN_CALLBACK useropen, FMOD_FILE_CLOSE_CALLBACK userclose, FMOD_FILE_READ_CALLBACK userread, FMOD_FILE_SEEK_CALLBACK userseek);
66 | FMOD_RESULT F_API FMOD_System_SetAdvancedSettings (FMOD_SYSTEM *system, FMOD_ADVANCEDSETTINGS *settings);
67 | FMOD_RESULT F_API FMOD_System_GetAdvancedSettings (FMOD_SYSTEM *system, FMOD_ADVANCEDSETTINGS *settings);
68 | FMOD_RESULT F_API FMOD_System_SetCallback (FMOD_SYSTEM *system, FMOD_SYSTEM_CALLBACK callback, FMOD_SYSTEM_CALLBACK_TYPE callbackmask);
69 |
70 | /*
71 | Plug-in support.
72 | */
73 |
74 | FMOD_RESULT F_API FMOD_System_SetPluginPath (FMOD_SYSTEM *system, const char *path);
75 | FMOD_RESULT F_API FMOD_System_LoadPlugin (FMOD_SYSTEM *system, const char *filename, unsigned int *handle, unsigned int priority);
76 | FMOD_RESULT F_API FMOD_System_UnloadPlugin (FMOD_SYSTEM *system, unsigned int handle);
77 | FMOD_RESULT F_API FMOD_System_GetNumNestedPlugins (FMOD_SYSTEM *system, unsigned int handle, int *count);
78 | FMOD_RESULT F_API FMOD_System_GetNestedPlugin (FMOD_SYSTEM *system, unsigned int handle, int index, unsigned int *nestedhandle);
79 | FMOD_RESULT F_API FMOD_System_GetNumPlugins (FMOD_SYSTEM *system, FMOD_PLUGINTYPE plugintype, int *numplugins);
80 | FMOD_RESULT F_API FMOD_System_GetPluginHandle (FMOD_SYSTEM *system, FMOD_PLUGINTYPE plugintype, int index, unsigned int *handle);
81 | FMOD_RESULT F_API FMOD_System_GetPluginInfo (FMOD_SYSTEM *system, unsigned int handle, FMOD_PLUGINTYPE *plugintype, char *name, int namelen, unsigned int *version);
82 | FMOD_RESULT F_API FMOD_System_SetOutputByPlugin (FMOD_SYSTEM *system, unsigned int handle);
83 | FMOD_RESULT F_API FMOD_System_GetOutputByPlugin (FMOD_SYSTEM *system, unsigned int *handle);
84 | FMOD_RESULT F_API FMOD_System_CreateDSPByPlugin (FMOD_SYSTEM *system, unsigned int handle, FMOD_DSP **dsp);
85 | FMOD_RESULT F_API FMOD_System_GetDSPInfoByPlugin (FMOD_SYSTEM *system, unsigned int handle, const FMOD_DSP_DESCRIPTION **description);
86 | FMOD_RESULT F_API FMOD_System_RegisterCodec (FMOD_SYSTEM *system, FMOD_CODEC_DESCRIPTION *description, unsigned int *handle, unsigned int priority);
87 | FMOD_RESULT F_API FMOD_System_RegisterDSP (FMOD_SYSTEM *system, const FMOD_DSP_DESCRIPTION *description, unsigned int *handle);
88 | FMOD_RESULT F_API FMOD_System_RegisterOutput (FMOD_SYSTEM *system, const FMOD_OUTPUT_DESCRIPTION *description, unsigned int *handle);
89 |
90 | /*
91 | Init/Close.
92 | */
93 |
94 | FMOD_RESULT F_API FMOD_System_Init (FMOD_SYSTEM *system, int maxchannels, FMOD_INITFLAGS flags, void *extradriverdata);
95 | FMOD_RESULT F_API FMOD_System_Close (FMOD_SYSTEM *system);
96 |
97 | /*
98 | General post-init system functions.
99 | */
100 |
101 | FMOD_RESULT F_API FMOD_System_Update (FMOD_SYSTEM *system);
102 |
103 | FMOD_RESULT F_API FMOD_System_SetSpeakerPosition (FMOD_SYSTEM *system, FMOD_SPEAKER speaker, float x, float y, FMOD_BOOL active);
104 | FMOD_RESULT F_API FMOD_System_GetSpeakerPosition (FMOD_SYSTEM *system, FMOD_SPEAKER speaker, float *x, float *y, FMOD_BOOL *active);
105 | FMOD_RESULT F_API FMOD_System_SetStreamBufferSize (FMOD_SYSTEM *system, unsigned int filebuffersize, FMOD_TIMEUNIT filebuffersizetype);
106 | FMOD_RESULT F_API FMOD_System_GetStreamBufferSize (FMOD_SYSTEM *system, unsigned int *filebuffersize, FMOD_TIMEUNIT *filebuffersizetype);
107 | FMOD_RESULT F_API FMOD_System_Set3DSettings (FMOD_SYSTEM *system, float dopplerscale, float distancefactor, float rolloffscale);
108 | FMOD_RESULT F_API FMOD_System_Get3DSettings (FMOD_SYSTEM *system, float *dopplerscale, float *distancefactor, float *rolloffscale);
109 | FMOD_RESULT F_API FMOD_System_Set3DNumListeners (FMOD_SYSTEM *system, int numlisteners);
110 | FMOD_RESULT F_API FMOD_System_Get3DNumListeners (FMOD_SYSTEM *system, int *numlisteners);
111 | FMOD_RESULT F_API FMOD_System_Set3DListenerAttributes (FMOD_SYSTEM *system, int listener, const FMOD_VECTOR *pos, const FMOD_VECTOR *vel, const FMOD_VECTOR *forward, const FMOD_VECTOR *up);
112 | FMOD_RESULT F_API FMOD_System_Get3DListenerAttributes (FMOD_SYSTEM *system, int listener, FMOD_VECTOR *pos, FMOD_VECTOR *vel, FMOD_VECTOR *forward, FMOD_VECTOR *up);
113 | FMOD_RESULT F_API FMOD_System_Set3DRolloffCallback (FMOD_SYSTEM *system, FMOD_3D_ROLLOFF_CALLBACK callback);
114 | FMOD_RESULT F_API FMOD_System_MixerSuspend (FMOD_SYSTEM *system);
115 | FMOD_RESULT F_API FMOD_System_MixerResume (FMOD_SYSTEM *system);
116 | FMOD_RESULT F_API FMOD_System_GetDefaultMixMatrix (FMOD_SYSTEM *system, FMOD_SPEAKERMODE sourcespeakermode, FMOD_SPEAKERMODE targetspeakermode, float *matrix, int matrixhop);
117 | FMOD_RESULT F_API FMOD_System_GetSpeakerModeChannels (FMOD_SYSTEM *system, FMOD_SPEAKERMODE mode, int *channels);
118 |
119 | /*
120 | System information functions.
121 | */
122 |
123 | FMOD_RESULT F_API FMOD_System_GetVersion (FMOD_SYSTEM *system, unsigned int *version);
124 | FMOD_RESULT F_API FMOD_System_GetOutputHandle (FMOD_SYSTEM *system, void **handle);
125 | FMOD_RESULT F_API FMOD_System_GetChannelsPlaying (FMOD_SYSTEM *system, int *channels, int *realchannels);
126 | FMOD_RESULT F_API FMOD_System_GetCPUUsage (FMOD_SYSTEM *system, float *dsp, float *stream, float *geometry, float *update, float *total);
127 | FMOD_RESULT F_API FMOD_System_GetFileUsage (FMOD_SYSTEM *system, long long *sampleBytesRead, long long *streamBytesRead, long long *otherBytesRead);
128 | FMOD_RESULT F_API FMOD_System_GetSoundRAM (FMOD_SYSTEM *system, int *currentalloced, int *maxalloced, int *total);
129 |
130 | /*
131 | Sound/DSP/Channel/FX creation and retrieval.
132 | */
133 |
134 | FMOD_RESULT F_API FMOD_System_CreateSound (FMOD_SYSTEM *system, const char *name_or_data, FMOD_MODE mode, FMOD_CREATESOUNDEXINFO *exinfo, FMOD_SOUND **sound);
135 | FMOD_RESULT F_API FMOD_System_CreateStream (FMOD_SYSTEM *system, const char *name_or_data, FMOD_MODE mode, FMOD_CREATESOUNDEXINFO *exinfo, FMOD_SOUND **sound);
136 | FMOD_RESULT F_API FMOD_System_CreateDSP (FMOD_SYSTEM *system, const FMOD_DSP_DESCRIPTION *description, FMOD_DSP **dsp);
137 | FMOD_RESULT F_API FMOD_System_CreateDSPByType (FMOD_SYSTEM *system, FMOD_DSP_TYPE type, FMOD_DSP **dsp);
138 | FMOD_RESULT F_API FMOD_System_CreateChannelGroup (FMOD_SYSTEM *system, const char *name, FMOD_CHANNELGROUP **channelgroup);
139 | FMOD_RESULT F_API FMOD_System_CreateSoundGroup (FMOD_SYSTEM *system, const char *name, FMOD_SOUNDGROUP **soundgroup);
140 | FMOD_RESULT F_API FMOD_System_CreateReverb3D (FMOD_SYSTEM *system, FMOD_REVERB3D **reverb);
141 |
142 | FMOD_RESULT F_API FMOD_System_PlaySound (FMOD_SYSTEM *system, FMOD_SOUND *sound, FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL paused, FMOD_CHANNEL **channel);
143 | FMOD_RESULT F_API FMOD_System_PlayDSP (FMOD_SYSTEM *system, FMOD_DSP *dsp, FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL paused, FMOD_CHANNEL **channel);
144 | FMOD_RESULT F_API FMOD_System_GetChannel (FMOD_SYSTEM *system, int channelid, FMOD_CHANNEL **channel);
145 | FMOD_RESULT F_API FMOD_System_GetMasterChannelGroup (FMOD_SYSTEM *system, FMOD_CHANNELGROUP **channelgroup);
146 | FMOD_RESULT F_API FMOD_System_GetMasterSoundGroup (FMOD_SYSTEM *system, FMOD_SOUNDGROUP **soundgroup);
147 |
148 | /*
149 | Routing to ports.
150 | */
151 |
152 | FMOD_RESULT F_API FMOD_System_AttachChannelGroupToPort (FMOD_SYSTEM *system, FMOD_PORT_TYPE portType, FMOD_PORT_INDEX portIndex, FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL passThru);
153 | FMOD_RESULT F_API FMOD_System_DetachChannelGroupFromPort(FMOD_SYSTEM *system, FMOD_CHANNELGROUP *channelgroup);
154 |
155 | /*
156 | Reverb API.
157 | */
158 |
159 | FMOD_RESULT F_API FMOD_System_SetReverbProperties (FMOD_SYSTEM *system, int instance, const FMOD_REVERB_PROPERTIES *prop);
160 | FMOD_RESULT F_API FMOD_System_GetReverbProperties (FMOD_SYSTEM *system, int instance, FMOD_REVERB_PROPERTIES *prop);
161 |
162 | /*
163 | System level DSP functionality.
164 | */
165 |
166 | FMOD_RESULT F_API FMOD_System_LockDSP (FMOD_SYSTEM *system);
167 | FMOD_RESULT F_API FMOD_System_UnlockDSP (FMOD_SYSTEM *system);
168 |
169 | /*
170 | Recording API.
171 | */
172 |
173 | FMOD_RESULT F_API FMOD_System_GetRecordNumDrivers (FMOD_SYSTEM *system, int *numdrivers, int *numconnected);
174 | FMOD_RESULT F_API FMOD_System_GetRecordDriverInfo (FMOD_SYSTEM *system, int id, char *name, int namelen, FMOD_GUID *guid, int *systemrate, FMOD_SPEAKERMODE *speakermode, int *speakermodechannels, FMOD_DRIVER_STATE *state);
175 | FMOD_RESULT F_API FMOD_System_GetRecordPosition (FMOD_SYSTEM *system, int id, unsigned int *position);
176 | FMOD_RESULT F_API FMOD_System_RecordStart (FMOD_SYSTEM *system, int id, FMOD_SOUND *sound, FMOD_BOOL loop);
177 | FMOD_RESULT F_API FMOD_System_RecordStop (FMOD_SYSTEM *system, int id);
178 | FMOD_RESULT F_API FMOD_System_IsRecording (FMOD_SYSTEM *system, int id, FMOD_BOOL *recording);
179 |
180 | /*
181 | Geometry API.
182 | */
183 |
184 | FMOD_RESULT F_API FMOD_System_CreateGeometry (FMOD_SYSTEM *system, int maxpolygons, int maxvertices, FMOD_GEOMETRY **geometry);
185 | FMOD_RESULT F_API FMOD_System_SetGeometrySettings (FMOD_SYSTEM *system, float maxworldsize);
186 | FMOD_RESULT F_API FMOD_System_GetGeometrySettings (FMOD_SYSTEM *system, float *maxworldsize);
187 | FMOD_RESULT F_API FMOD_System_LoadGeometry (FMOD_SYSTEM *system, const void *data, int datasize, FMOD_GEOMETRY **geometry);
188 | FMOD_RESULT F_API FMOD_System_GetGeometryOcclusion (FMOD_SYSTEM *system, const FMOD_VECTOR *listener, const FMOD_VECTOR *source, float *direct, float *reverb);
189 |
190 | /*
191 | Network functions.
192 | */
193 |
194 | FMOD_RESULT F_API FMOD_System_SetNetworkProxy (FMOD_SYSTEM *system, const char *proxy);
195 | FMOD_RESULT F_API FMOD_System_GetNetworkProxy (FMOD_SYSTEM *system, char *proxy, int proxylen);
196 | FMOD_RESULT F_API FMOD_System_SetNetworkTimeout (FMOD_SYSTEM *system, int timeout);
197 | FMOD_RESULT F_API FMOD_System_GetNetworkTimeout (FMOD_SYSTEM *system, int *timeout);
198 |
199 | /*
200 | Userdata set/get.
201 | */
202 |
203 | FMOD_RESULT F_API FMOD_System_SetUserData (FMOD_SYSTEM *system, void *userdata);
204 | FMOD_RESULT F_API FMOD_System_GetUserData (FMOD_SYSTEM *system, void **userdata);
205 |
206 | /*
207 | 'Sound' API
208 | */
209 |
210 | FMOD_RESULT F_API FMOD_Sound_Release (FMOD_SOUND *sound);
211 | FMOD_RESULT F_API FMOD_Sound_GetSystemObject (FMOD_SOUND *sound, FMOD_SYSTEM **system);
212 |
213 | /*
214 | Standard sound manipulation functions.
215 | */
216 |
217 | FMOD_RESULT F_API FMOD_Sound_Lock (FMOD_SOUND *sound, unsigned int offset, unsigned int length, void **ptr1, void **ptr2, unsigned int *len1, unsigned int *len2);
218 | FMOD_RESULT F_API FMOD_Sound_Unlock (FMOD_SOUND *sound, void *ptr1, void *ptr2, unsigned int len1, unsigned int len2);
219 | FMOD_RESULT F_API FMOD_Sound_SetDefaults (FMOD_SOUND *sound, float frequency, int priority);
220 | FMOD_RESULT F_API FMOD_Sound_GetDefaults (FMOD_SOUND *sound, float *frequency, int *priority);
221 | FMOD_RESULT F_API FMOD_Sound_Set3DMinMaxDistance (FMOD_SOUND *sound, float min, float max);
222 | FMOD_RESULT F_API FMOD_Sound_Get3DMinMaxDistance (FMOD_SOUND *sound, float *min, float *max);
223 | FMOD_RESULT F_API FMOD_Sound_Set3DConeSettings (FMOD_SOUND *sound, float insideconeangle, float outsideconeangle, float outsidevolume);
224 | FMOD_RESULT F_API FMOD_Sound_Get3DConeSettings (FMOD_SOUND *sound, float *insideconeangle, float *outsideconeangle, float *outsidevolume);
225 | FMOD_RESULT F_API FMOD_Sound_Set3DCustomRolloff (FMOD_SOUND *sound, FMOD_VECTOR *points, int numpoints);
226 | FMOD_RESULT F_API FMOD_Sound_Get3DCustomRolloff (FMOD_SOUND *sound, FMOD_VECTOR **points, int *numpoints);
227 | FMOD_RESULT F_API FMOD_Sound_GetSubSound (FMOD_SOUND *sound, int index, FMOD_SOUND **subsound);
228 | FMOD_RESULT F_API FMOD_Sound_GetSubSoundParent (FMOD_SOUND *sound, FMOD_SOUND **parentsound);
229 | FMOD_RESULT F_API FMOD_Sound_GetName (FMOD_SOUND *sound, char *name, int namelen);
230 | FMOD_RESULT F_API FMOD_Sound_GetLength (FMOD_SOUND *sound, unsigned int *length, FMOD_TIMEUNIT lengthtype);
231 | FMOD_RESULT F_API FMOD_Sound_GetFormat (FMOD_SOUND *sound, FMOD_SOUND_TYPE *type, FMOD_SOUND_FORMAT *format, int *channels, int *bits);
232 | FMOD_RESULT F_API FMOD_Sound_GetNumSubSounds (FMOD_SOUND *sound, int *numsubsounds);
233 | FMOD_RESULT F_API FMOD_Sound_GetNumTags (FMOD_SOUND *sound, int *numtags, int *numtagsupdated);
234 | FMOD_RESULT F_API FMOD_Sound_GetTag (FMOD_SOUND *sound, const char *name, int index, FMOD_TAG *tag);
235 | FMOD_RESULT F_API FMOD_Sound_GetOpenState (FMOD_SOUND *sound, FMOD_OPENSTATE *openstate, unsigned int *percentbuffered, FMOD_BOOL *starving, FMOD_BOOL *diskbusy);
236 | FMOD_RESULT F_API FMOD_Sound_ReadData (FMOD_SOUND *sound, void *buffer, unsigned int lenbytes, unsigned int *read);
237 | FMOD_RESULT F_API FMOD_Sound_SeekData (FMOD_SOUND *sound, unsigned int pcm);
238 |
239 | FMOD_RESULT F_API FMOD_Sound_SetSoundGroup (FMOD_SOUND *sound, FMOD_SOUNDGROUP *soundgroup);
240 | FMOD_RESULT F_API FMOD_Sound_GetSoundGroup (FMOD_SOUND *sound, FMOD_SOUNDGROUP **soundgroup);
241 |
242 | /*
243 | Synchronization point API. These points can come from markers embedded in wav files, and can also generate channel callbacks.
244 | */
245 |
246 | FMOD_RESULT F_API FMOD_Sound_GetNumSyncPoints (FMOD_SOUND *sound, int *numsyncpoints);
247 | FMOD_RESULT F_API FMOD_Sound_GetSyncPoint (FMOD_SOUND *sound, int index, FMOD_SYNCPOINT **point);
248 | FMOD_RESULT F_API FMOD_Sound_GetSyncPointInfo (FMOD_SOUND *sound, FMOD_SYNCPOINT *point, char *name, int namelen, unsigned int *offset, FMOD_TIMEUNIT offsettype);
249 | FMOD_RESULT F_API FMOD_Sound_AddSyncPoint (FMOD_SOUND *sound, unsigned int offset, FMOD_TIMEUNIT offsettype, const char *name, FMOD_SYNCPOINT **point);
250 | FMOD_RESULT F_API FMOD_Sound_DeleteSyncPoint (FMOD_SOUND *sound, FMOD_SYNCPOINT *point);
251 |
252 | /*
253 | Functions also in Channel class but here they are the 'default' to save having to change it in Channel all the time.
254 | */
255 |
256 | FMOD_RESULT F_API FMOD_Sound_SetMode (FMOD_SOUND *sound, FMOD_MODE mode);
257 | FMOD_RESULT F_API FMOD_Sound_GetMode (FMOD_SOUND *sound, FMOD_MODE *mode);
258 | FMOD_RESULT F_API FMOD_Sound_SetLoopCount (FMOD_SOUND *sound, int loopcount);
259 | FMOD_RESULT F_API FMOD_Sound_GetLoopCount (FMOD_SOUND *sound, int *loopcount);
260 | FMOD_RESULT F_API FMOD_Sound_SetLoopPoints (FMOD_SOUND *sound, unsigned int loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int loopend, FMOD_TIMEUNIT loopendtype);
261 | FMOD_RESULT F_API FMOD_Sound_GetLoopPoints (FMOD_SOUND *sound, unsigned int *loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int *loopend, FMOD_TIMEUNIT loopendtype);
262 |
263 | /*
264 | For MOD/S3M/XM/IT/MID sequenced formats only.
265 | */
266 |
267 | FMOD_RESULT F_API FMOD_Sound_GetMusicNumChannels (FMOD_SOUND *sound, int *numchannels);
268 | FMOD_RESULT F_API FMOD_Sound_SetMusicChannelVolume (FMOD_SOUND *sound, int channel, float volume);
269 | FMOD_RESULT F_API FMOD_Sound_GetMusicChannelVolume (FMOD_SOUND *sound, int channel, float *volume);
270 | FMOD_RESULT F_API FMOD_Sound_SetMusicSpeed (FMOD_SOUND *sound, float speed);
271 | FMOD_RESULT F_API FMOD_Sound_GetMusicSpeed (FMOD_SOUND *sound, float *speed);
272 |
273 | /*
274 | Userdata set/get.
275 | */
276 |
277 | FMOD_RESULT F_API FMOD_Sound_SetUserData (FMOD_SOUND *sound, void *userdata);
278 | FMOD_RESULT F_API FMOD_Sound_GetUserData (FMOD_SOUND *sound, void **userdata);
279 |
280 | /*
281 | 'Channel' API
282 | */
283 |
284 | FMOD_RESULT F_API FMOD_Channel_GetSystemObject (FMOD_CHANNEL *channel, FMOD_SYSTEM **system);
285 |
286 | /*
287 | General control functionality for Channels and ChannelGroups.
288 | */
289 |
290 | FMOD_RESULT F_API FMOD_Channel_Stop (FMOD_CHANNEL *channel);
291 | FMOD_RESULT F_API FMOD_Channel_SetPaused (FMOD_CHANNEL *channel, FMOD_BOOL paused);
292 | FMOD_RESULT F_API FMOD_Channel_GetPaused (FMOD_CHANNEL *channel, FMOD_BOOL *paused);
293 | FMOD_RESULT F_API FMOD_Channel_SetVolume (FMOD_CHANNEL *channel, float volume);
294 | FMOD_RESULT F_API FMOD_Channel_GetVolume (FMOD_CHANNEL *channel, float *volume);
295 | FMOD_RESULT F_API FMOD_Channel_SetVolumeRamp (FMOD_CHANNEL *channel, FMOD_BOOL ramp);
296 | FMOD_RESULT F_API FMOD_Channel_GetVolumeRamp (FMOD_CHANNEL *channel, FMOD_BOOL *ramp);
297 | FMOD_RESULT F_API FMOD_Channel_GetAudibility (FMOD_CHANNEL *channel, float *audibility);
298 | FMOD_RESULT F_API FMOD_Channel_SetPitch (FMOD_CHANNEL *channel, float pitch);
299 | FMOD_RESULT F_API FMOD_Channel_GetPitch (FMOD_CHANNEL *channel, float *pitch);
300 | FMOD_RESULT F_API FMOD_Channel_SetMute (FMOD_CHANNEL *channel, FMOD_BOOL mute);
301 | FMOD_RESULT F_API FMOD_Channel_GetMute (FMOD_CHANNEL *channel, FMOD_BOOL *mute);
302 | FMOD_RESULT F_API FMOD_Channel_SetReverbProperties (FMOD_CHANNEL *channel, int instance, float wet);
303 | FMOD_RESULT F_API FMOD_Channel_GetReverbProperties (FMOD_CHANNEL *channel, int instance, float *wet);
304 | FMOD_RESULT F_API FMOD_Channel_SetLowPassGain (FMOD_CHANNEL *channel, float gain);
305 | FMOD_RESULT F_API FMOD_Channel_GetLowPassGain (FMOD_CHANNEL *channel, float *gain);
306 | FMOD_RESULT F_API FMOD_Channel_SetMode (FMOD_CHANNEL *channel, FMOD_MODE mode);
307 | FMOD_RESULT F_API FMOD_Channel_GetMode (FMOD_CHANNEL *channel, FMOD_MODE *mode);
308 | FMOD_RESULT F_API FMOD_Channel_SetCallback (FMOD_CHANNEL *channel, FMOD_CHANNELCONTROL_CALLBACK callback);
309 | FMOD_RESULT F_API FMOD_Channel_IsPlaying (FMOD_CHANNEL *channel, FMOD_BOOL *isplaying);
310 |
311 | /*
312 | Note all 'set' functions alter a final matrix, this is why the only get function is getMixMatrix, to avoid other get functions returning incorrect/obsolete values.
313 | */
314 |
315 | FMOD_RESULT F_API FMOD_Channel_SetPan (FMOD_CHANNEL *channel, float pan);
316 | FMOD_RESULT F_API FMOD_Channel_SetMixLevelsOutput (FMOD_CHANNEL *channel, float frontleft, float frontright, float center, float lfe, float surroundleft, float surroundright, float backleft, float backright);
317 | FMOD_RESULT F_API FMOD_Channel_SetMixLevelsInput (FMOD_CHANNEL *channel, float *levels, int numlevels);
318 | FMOD_RESULT F_API FMOD_Channel_SetMixMatrix (FMOD_CHANNEL *channel, float *matrix, int outchannels, int inchannels, int inchannel_hop);
319 | FMOD_RESULT F_API FMOD_Channel_GetMixMatrix (FMOD_CHANNEL *channel, float *matrix, int *outchannels, int *inchannels, int inchannel_hop);
320 |
321 | /*
322 | Clock based functionality.
323 | */
324 |
325 | FMOD_RESULT F_API FMOD_Channel_GetDSPClock (FMOD_CHANNEL *channel, unsigned long long *dspclock, unsigned long long *parentclock);
326 | FMOD_RESULT F_API FMOD_Channel_SetDelay (FMOD_CHANNEL *channel, unsigned long long dspclock_start, unsigned long long dspclock_end, FMOD_BOOL stopchannels);
327 | FMOD_RESULT F_API FMOD_Channel_GetDelay (FMOD_CHANNEL *channel, unsigned long long *dspclock_start, unsigned long long *dspclock_end, FMOD_BOOL *stopchannels);
328 | FMOD_RESULT F_API FMOD_Channel_AddFadePoint (FMOD_CHANNEL *channel, unsigned long long dspclock, float volume);
329 | FMOD_RESULT F_API FMOD_Channel_SetFadePointRamp (FMOD_CHANNEL *channel, unsigned long long dspclock, float volume);
330 | FMOD_RESULT F_API FMOD_Channel_RemoveFadePoints (FMOD_CHANNEL *channel, unsigned long long dspclock_start, unsigned long long dspclock_end);
331 | FMOD_RESULT F_API FMOD_Channel_GetFadePoints (FMOD_CHANNEL *channel, unsigned int *numpoints, unsigned long long *point_dspclock, float *point_volume);
332 |
333 | /*
334 | DSP effects.
335 | */
336 |
337 | FMOD_RESULT F_API FMOD_Channel_GetDSP (FMOD_CHANNEL *channel, int index, FMOD_DSP **dsp);
338 | FMOD_RESULT F_API FMOD_Channel_AddDSP (FMOD_CHANNEL *channel, int index, FMOD_DSP *dsp);
339 | FMOD_RESULT F_API FMOD_Channel_RemoveDSP (FMOD_CHANNEL *channel, FMOD_DSP *dsp);
340 | FMOD_RESULT F_API FMOD_Channel_GetNumDSPs (FMOD_CHANNEL *channel, int *numdsps);
341 | FMOD_RESULT F_API FMOD_Channel_SetDSPIndex (FMOD_CHANNEL *channel, FMOD_DSP *dsp, int index);
342 | FMOD_RESULT F_API FMOD_Channel_GetDSPIndex (FMOD_CHANNEL *channel, FMOD_DSP *dsp, int *index);
343 | FMOD_RESULT F_API FMOD_Channel_OverridePanDSP (FMOD_CHANNEL *channel, FMOD_DSP *pan);
344 |
345 | /*
346 | 3D functionality.
347 | */
348 |
349 | FMOD_RESULT F_API FMOD_Channel_Set3DAttributes (FMOD_CHANNEL *channel, const FMOD_VECTOR *pos, const FMOD_VECTOR *vel, const FMOD_VECTOR *alt_pan_pos);
350 | FMOD_RESULT F_API FMOD_Channel_Get3DAttributes (FMOD_CHANNEL *channel, FMOD_VECTOR *pos, FMOD_VECTOR *vel, FMOD_VECTOR *alt_pan_pos);
351 | FMOD_RESULT F_API FMOD_Channel_Set3DMinMaxDistance (FMOD_CHANNEL *channel, float mindistance, float maxdistance);
352 | FMOD_RESULT F_API FMOD_Channel_Get3DMinMaxDistance (FMOD_CHANNEL *channel, float *mindistance, float *maxdistance);
353 | FMOD_RESULT F_API FMOD_Channel_Set3DConeSettings (FMOD_CHANNEL *channel, float insideconeangle, float outsideconeangle, float outsidevolume);
354 | FMOD_RESULT F_API FMOD_Channel_Get3DConeSettings (FMOD_CHANNEL *channel, float *insideconeangle, float *outsideconeangle, float *outsidevolume);
355 | FMOD_RESULT F_API FMOD_Channel_Set3DConeOrientation (FMOD_CHANNEL *channel, FMOD_VECTOR *orientation);
356 | FMOD_RESULT F_API FMOD_Channel_Get3DConeOrientation (FMOD_CHANNEL *channel, FMOD_VECTOR *orientation);
357 | FMOD_RESULT F_API FMOD_Channel_Set3DCustomRolloff (FMOD_CHANNEL *channel, FMOD_VECTOR *points, int numpoints);
358 | FMOD_RESULT F_API FMOD_Channel_Get3DCustomRolloff (FMOD_CHANNEL *channel, FMOD_VECTOR **points, int *numpoints);
359 | FMOD_RESULT F_API FMOD_Channel_Set3DOcclusion (FMOD_CHANNEL *channel, float directocclusion, float reverbocclusion);
360 | FMOD_RESULT F_API FMOD_Channel_Get3DOcclusion (FMOD_CHANNEL *channel, float *directocclusion, float *reverbocclusion);
361 | FMOD_RESULT F_API FMOD_Channel_Set3DSpread (FMOD_CHANNEL *channel, float angle);
362 | FMOD_RESULT F_API FMOD_Channel_Get3DSpread (FMOD_CHANNEL *channel, float *angle);
363 | FMOD_RESULT F_API FMOD_Channel_Set3DLevel (FMOD_CHANNEL *channel, float level);
364 | FMOD_RESULT F_API FMOD_Channel_Get3DLevel (FMOD_CHANNEL *channel, float *level);
365 | FMOD_RESULT F_API FMOD_Channel_Set3DDopplerLevel (FMOD_CHANNEL *channel, float level);
366 | FMOD_RESULT F_API FMOD_Channel_Get3DDopplerLevel (FMOD_CHANNEL *channel, float *level);
367 | FMOD_RESULT F_API FMOD_Channel_Set3DDistanceFilter (FMOD_CHANNEL *channel, FMOD_BOOL custom, float customLevel, float centerFreq);
368 | FMOD_RESULT F_API FMOD_Channel_Get3DDistanceFilter (FMOD_CHANNEL *channel, FMOD_BOOL *custom, float *customLevel, float *centerFreq);
369 |
370 | /*
371 | Userdata set/get.
372 | */
373 |
374 | FMOD_RESULT F_API FMOD_Channel_SetUserData (FMOD_CHANNEL *channel, void *userdata);
375 | FMOD_RESULT F_API FMOD_Channel_GetUserData (FMOD_CHANNEL *channel, void **userdata);
376 |
377 | /*
378 | Channel specific control functionality.
379 | */
380 |
381 | FMOD_RESULT F_API FMOD_Channel_SetFrequency (FMOD_CHANNEL *channel, float frequency);
382 | FMOD_RESULT F_API FMOD_Channel_GetFrequency (FMOD_CHANNEL *channel, float *frequency);
383 | FMOD_RESULT F_API FMOD_Channel_SetPriority (FMOD_CHANNEL *channel, int priority);
384 | FMOD_RESULT F_API FMOD_Channel_GetPriority (FMOD_CHANNEL *channel, int *priority);
385 | FMOD_RESULT F_API FMOD_Channel_SetPosition (FMOD_CHANNEL *channel, unsigned int position, FMOD_TIMEUNIT postype);
386 | FMOD_RESULT F_API FMOD_Channel_GetPosition (FMOD_CHANNEL *channel, unsigned int *position, FMOD_TIMEUNIT postype);
387 | FMOD_RESULT F_API FMOD_Channel_SetChannelGroup (FMOD_CHANNEL *channel, FMOD_CHANNELGROUP *channelgroup);
388 | FMOD_RESULT F_API FMOD_Channel_GetChannelGroup (FMOD_CHANNEL *channel, FMOD_CHANNELGROUP **channelgroup);
389 | FMOD_RESULT F_API FMOD_Channel_SetLoopCount (FMOD_CHANNEL *channel, int loopcount);
390 | FMOD_RESULT F_API FMOD_Channel_GetLoopCount (FMOD_CHANNEL *channel, int *loopcount);
391 | FMOD_RESULT F_API FMOD_Channel_SetLoopPoints (FMOD_CHANNEL *channel, unsigned int loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int loopend, FMOD_TIMEUNIT loopendtype);
392 | FMOD_RESULT F_API FMOD_Channel_GetLoopPoints (FMOD_CHANNEL *channel, unsigned int *loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int *loopend, FMOD_TIMEUNIT loopendtype);
393 |
394 | /*
395 | Information only functions.
396 | */
397 |
398 | FMOD_RESULT F_API FMOD_Channel_IsVirtual (FMOD_CHANNEL *channel, FMOD_BOOL *isvirtual);
399 | FMOD_RESULT F_API FMOD_Channel_GetCurrentSound (FMOD_CHANNEL *channel, FMOD_SOUND **sound);
400 | FMOD_RESULT F_API FMOD_Channel_GetIndex (FMOD_CHANNEL *channel, int *index);
401 |
402 | /*
403 | 'ChannelGroup' API
404 | */
405 |
406 | FMOD_RESULT F_API FMOD_ChannelGroup_GetSystemObject (FMOD_CHANNELGROUP *channelgroup, FMOD_SYSTEM **system);
407 |
408 | /*
409 | General control functionality for Channels and ChannelGroups.
410 | */
411 |
412 | FMOD_RESULT F_API FMOD_ChannelGroup_Stop (FMOD_CHANNELGROUP *channelgroup);
413 | FMOD_RESULT F_API FMOD_ChannelGroup_SetPaused (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL paused);
414 | FMOD_RESULT F_API FMOD_ChannelGroup_GetPaused (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL *paused);
415 | FMOD_RESULT F_API FMOD_ChannelGroup_SetVolume (FMOD_CHANNELGROUP *channelgroup, float volume);
416 | FMOD_RESULT F_API FMOD_ChannelGroup_GetVolume (FMOD_CHANNELGROUP *channelgroup, float *volume);
417 | FMOD_RESULT F_API FMOD_ChannelGroup_SetVolumeRamp (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL ramp);
418 | FMOD_RESULT F_API FMOD_ChannelGroup_GetVolumeRamp (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL *ramp);
419 | FMOD_RESULT F_API FMOD_ChannelGroup_GetAudibility (FMOD_CHANNELGROUP *channelgroup, float *audibility);
420 | FMOD_RESULT F_API FMOD_ChannelGroup_SetPitch (FMOD_CHANNELGROUP *channelgroup, float pitch);
421 | FMOD_RESULT F_API FMOD_ChannelGroup_GetPitch (FMOD_CHANNELGROUP *channelgroup, float *pitch);
422 | FMOD_RESULT F_API FMOD_ChannelGroup_SetMute (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL mute);
423 | FMOD_RESULT F_API FMOD_ChannelGroup_GetMute (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL *mute);
424 | FMOD_RESULT F_API FMOD_ChannelGroup_SetReverbProperties (FMOD_CHANNELGROUP *channelgroup, int instance, float wet);
425 | FMOD_RESULT F_API FMOD_ChannelGroup_GetReverbProperties (FMOD_CHANNELGROUP *channelgroup, int instance, float *wet);
426 | FMOD_RESULT F_API FMOD_ChannelGroup_SetLowPassGain (FMOD_CHANNELGROUP *channelgroup, float gain);
427 | FMOD_RESULT F_API FMOD_ChannelGroup_GetLowPassGain (FMOD_CHANNELGROUP *channelgroup, float *gain);
428 | FMOD_RESULT F_API FMOD_ChannelGroup_SetMode (FMOD_CHANNELGROUP *channelgroup, FMOD_MODE mode);
429 | FMOD_RESULT F_API FMOD_ChannelGroup_GetMode (FMOD_CHANNELGROUP *channelgroup, FMOD_MODE *mode);
430 | FMOD_RESULT F_API FMOD_ChannelGroup_SetCallback (FMOD_CHANNELGROUP *channelgroup, FMOD_CHANNELCONTROL_CALLBACK callback);
431 | FMOD_RESULT F_API FMOD_ChannelGroup_IsPlaying (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL *isplaying);
432 |
433 | /*
434 | Note all 'set' functions alter a final matrix, this is why the only get function is getMixMatrix, to avoid other get functions returning incorrect/obsolete values.
435 | */
436 |
437 | FMOD_RESULT F_API FMOD_ChannelGroup_SetPan (FMOD_CHANNELGROUP *channelgroup, float pan);
438 | FMOD_RESULT F_API FMOD_ChannelGroup_SetMixLevelsOutput (FMOD_CHANNELGROUP *channelgroup, float frontleft, float frontright, float center, float lfe, float surroundleft, float surroundright, float backleft, float backright);
439 | FMOD_RESULT F_API FMOD_ChannelGroup_SetMixLevelsInput (FMOD_CHANNELGROUP *channelgroup, float *levels, int numlevels);
440 | FMOD_RESULT F_API FMOD_ChannelGroup_SetMixMatrix (FMOD_CHANNELGROUP *channelgroup, float *matrix, int outchannels, int inchannels, int inchannel_hop);
441 | FMOD_RESULT F_API FMOD_ChannelGroup_GetMixMatrix (FMOD_CHANNELGROUP *channelgroup, float *matrix, int *outchannels, int *inchannels, int inchannel_hop);
442 |
443 | /*
444 | Clock based functionality.
445 | */
446 |
447 | FMOD_RESULT F_API FMOD_ChannelGroup_GetDSPClock (FMOD_CHANNELGROUP *channelgroup, unsigned long long *dspclock, unsigned long long *parentclock);
448 | FMOD_RESULT F_API FMOD_ChannelGroup_SetDelay (FMOD_CHANNELGROUP *channelgroup, unsigned long long dspclock_start, unsigned long long dspclock_end, FMOD_BOOL stopchannels);
449 | FMOD_RESULT F_API FMOD_ChannelGroup_GetDelay (FMOD_CHANNELGROUP *channelgroup, unsigned long long *dspclock_start, unsigned long long *dspclock_end, FMOD_BOOL *stopchannels);
450 | FMOD_RESULT F_API FMOD_ChannelGroup_AddFadePoint (FMOD_CHANNELGROUP *channelgroup, unsigned long long dspclock, float volume);
451 | FMOD_RESULT F_API FMOD_ChannelGroup_SetFadePointRamp (FMOD_CHANNELGROUP *channelgroup, unsigned long long dspclock, float volume);
452 | FMOD_RESULT F_API FMOD_ChannelGroup_RemoveFadePoints (FMOD_CHANNELGROUP *channelgroup, unsigned long long dspclock_start, unsigned long long dspclock_end);
453 | FMOD_RESULT F_API FMOD_ChannelGroup_GetFadePoints (FMOD_CHANNELGROUP *channelgroup, unsigned int *numpoints, unsigned long long *point_dspclock, float *point_volume);
454 |
455 | /*
456 | DSP effects.
457 | */
458 |
459 | FMOD_RESULT F_API FMOD_ChannelGroup_GetDSP (FMOD_CHANNELGROUP *channelgroup, int index, FMOD_DSP **dsp);
460 | FMOD_RESULT F_API FMOD_ChannelGroup_AddDSP (FMOD_CHANNELGROUP *channelgroup, int index, FMOD_DSP *dsp);
461 | FMOD_RESULT F_API FMOD_ChannelGroup_RemoveDSP (FMOD_CHANNELGROUP *channelgroup, FMOD_DSP *dsp);
462 | FMOD_RESULT F_API FMOD_ChannelGroup_GetNumDSPs (FMOD_CHANNELGROUP *channelgroup, int *numdsps);
463 | FMOD_RESULT F_API FMOD_ChannelGroup_SetDSPIndex (FMOD_CHANNELGROUP *channelgroup, FMOD_DSP *dsp, int index);
464 | FMOD_RESULT F_API FMOD_ChannelGroup_GetDSPIndex (FMOD_CHANNELGROUP *channelgroup, FMOD_DSP *dsp, int *index);
465 | FMOD_RESULT F_API FMOD_ChannelGroup_OverridePanDSP (FMOD_CHANNELGROUP *channelgroup, FMOD_DSP *pan);
466 |
467 | /*
468 | 3D functionality.
469 | */
470 |
471 | FMOD_RESULT F_API FMOD_ChannelGroup_Set3DAttributes (FMOD_CHANNELGROUP *channelgroup, const FMOD_VECTOR *pos, const FMOD_VECTOR *vel, const FMOD_VECTOR *alt_pan_pos);
472 | FMOD_RESULT F_API FMOD_ChannelGroup_Get3DAttributes (FMOD_CHANNELGROUP *channelgroup, FMOD_VECTOR *pos, FMOD_VECTOR *vel, FMOD_VECTOR *alt_pan_pos);
473 | FMOD_RESULT F_API FMOD_ChannelGroup_Set3DMinMaxDistance (FMOD_CHANNELGROUP *channelgroup, float mindistance, float maxdistance);
474 | FMOD_RESULT F_API FMOD_ChannelGroup_Get3DMinMaxDistance (FMOD_CHANNELGROUP *channelgroup, float *mindistance, float *maxdistance);
475 | FMOD_RESULT F_API FMOD_ChannelGroup_Set3DConeSettings (FMOD_CHANNELGROUP *channelgroup, float insideconeangle, float outsideconeangle, float outsidevolume);
476 | FMOD_RESULT F_API FMOD_ChannelGroup_Get3DConeSettings (FMOD_CHANNELGROUP *channelgroup, float *insideconeangle, float *outsideconeangle, float *outsidevolume);
477 | FMOD_RESULT F_API FMOD_ChannelGroup_Set3DConeOrientation(FMOD_CHANNELGROUP *channelgroup, FMOD_VECTOR *orientation);
478 | FMOD_RESULT F_API FMOD_ChannelGroup_Get3DConeOrientation(FMOD_CHANNELGROUP *channelgroup, FMOD_VECTOR *orientation);
479 | FMOD_RESULT F_API FMOD_ChannelGroup_Set3DCustomRolloff (FMOD_CHANNELGROUP *channelgroup, FMOD_VECTOR *points, int numpoints);
480 | FMOD_RESULT F_API FMOD_ChannelGroup_Get3DCustomRolloff (FMOD_CHANNELGROUP *channelgroup, FMOD_VECTOR **points, int *numpoints);
481 | FMOD_RESULT F_API FMOD_ChannelGroup_Set3DOcclusion (FMOD_CHANNELGROUP *channelgroup, float directocclusion, float reverbocclusion);
482 | FMOD_RESULT F_API FMOD_ChannelGroup_Get3DOcclusion (FMOD_CHANNELGROUP *channelgroup, float *directocclusion, float *reverbocclusion);
483 | FMOD_RESULT F_API FMOD_ChannelGroup_Set3DSpread (FMOD_CHANNELGROUP *channelgroup, float angle);
484 | FMOD_RESULT F_API FMOD_ChannelGroup_Get3DSpread (FMOD_CHANNELGROUP *channelgroup, float *angle);
485 | FMOD_RESULT F_API FMOD_ChannelGroup_Set3DLevel (FMOD_CHANNELGROUP *channelgroup, float level);
486 | FMOD_RESULT F_API FMOD_ChannelGroup_Get3DLevel (FMOD_CHANNELGROUP *channelgroup, float *level);
487 | FMOD_RESULT F_API FMOD_ChannelGroup_Set3DDopplerLevel (FMOD_CHANNELGROUP *channelgroup, float level);
488 | FMOD_RESULT F_API FMOD_ChannelGroup_Get3DDopplerLevel (FMOD_CHANNELGROUP *channelgroup, float *level);
489 | FMOD_RESULT F_API FMOD_ChannelGroup_Set3DDistanceFilter (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL custom, float customLevel, float centerFreq);
490 | FMOD_RESULT F_API FMOD_ChannelGroup_Get3DDistanceFilter (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL *custom, float *customLevel, float *centerFreq);
491 |
492 | /*
493 | Userdata set/get.
494 | */
495 |
496 | FMOD_RESULT F_API FMOD_ChannelGroup_SetUserData (FMOD_CHANNELGROUP *channelgroup, void *userdata);
497 | FMOD_RESULT F_API FMOD_ChannelGroup_GetUserData (FMOD_CHANNELGROUP *channelgroup, void **userdata);
498 |
499 | FMOD_RESULT F_API FMOD_ChannelGroup_Release (FMOD_CHANNELGROUP *channelgroup);
500 |
501 | /*
502 | Nested channel groups.
503 | */
504 |
505 | FMOD_RESULT F_API FMOD_ChannelGroup_AddGroup (FMOD_CHANNELGROUP *channelgroup, FMOD_CHANNELGROUP *group, FMOD_BOOL propagatedspclock, FMOD_DSPCONNECTION **connection);
506 | FMOD_RESULT F_API FMOD_ChannelGroup_GetNumGroups (FMOD_CHANNELGROUP *channelgroup, int *numgroups);
507 | FMOD_RESULT F_API FMOD_ChannelGroup_GetGroup (FMOD_CHANNELGROUP *channelgroup, int index, FMOD_CHANNELGROUP **group);
508 | FMOD_RESULT F_API FMOD_ChannelGroup_GetParentGroup (FMOD_CHANNELGROUP *channelgroup, FMOD_CHANNELGROUP **group);
509 |
510 | /*
511 | Information only functions.
512 | */
513 |
514 | FMOD_RESULT F_API FMOD_ChannelGroup_GetName (FMOD_CHANNELGROUP *channelgroup, char *name, int namelen);
515 | FMOD_RESULT F_API FMOD_ChannelGroup_GetNumChannels (FMOD_CHANNELGROUP *channelgroup, int *numchannels);
516 | FMOD_RESULT F_API FMOD_ChannelGroup_GetChannel (FMOD_CHANNELGROUP *channelgroup, int index, FMOD_CHANNEL **channel);
517 |
518 | /*
519 | 'SoundGroup' API
520 | */
521 |
522 | FMOD_RESULT F_API FMOD_SoundGroup_Release (FMOD_SOUNDGROUP *soundgroup);
523 | FMOD_RESULT F_API FMOD_SoundGroup_GetSystemObject (FMOD_SOUNDGROUP *soundgroup, FMOD_SYSTEM **system);
524 |
525 | /*
526 | SoundGroup control functions.
527 | */
528 |
529 | FMOD_RESULT F_API FMOD_SoundGroup_SetMaxAudible (FMOD_SOUNDGROUP *soundgroup, int maxaudible);
530 | FMOD_RESULT F_API FMOD_SoundGroup_GetMaxAudible (FMOD_SOUNDGROUP *soundgroup, int *maxaudible);
531 | FMOD_RESULT F_API FMOD_SoundGroup_SetMaxAudibleBehavior (FMOD_SOUNDGROUP *soundgroup, FMOD_SOUNDGROUP_BEHAVIOR behavior);
532 | FMOD_RESULT F_API FMOD_SoundGroup_GetMaxAudibleBehavior (FMOD_SOUNDGROUP *soundgroup, FMOD_SOUNDGROUP_BEHAVIOR *behavior);
533 | FMOD_RESULT F_API FMOD_SoundGroup_SetMuteFadeSpeed (FMOD_SOUNDGROUP *soundgroup, float speed);
534 | FMOD_RESULT F_API FMOD_SoundGroup_GetMuteFadeSpeed (FMOD_SOUNDGROUP *soundgroup, float *speed);
535 | FMOD_RESULT F_API FMOD_SoundGroup_SetVolume (FMOD_SOUNDGROUP *soundgroup, float volume);
536 | FMOD_RESULT F_API FMOD_SoundGroup_GetVolume (FMOD_SOUNDGROUP *soundgroup, float *volume);
537 | FMOD_RESULT F_API FMOD_SoundGroup_Stop (FMOD_SOUNDGROUP *soundgroup);
538 |
539 | /*
540 | Information only functions.
541 | */
542 |
543 | FMOD_RESULT F_API FMOD_SoundGroup_GetName (FMOD_SOUNDGROUP *soundgroup, char *name, int namelen);
544 | FMOD_RESULT F_API FMOD_SoundGroup_GetNumSounds (FMOD_SOUNDGROUP *soundgroup, int *numsounds);
545 | FMOD_RESULT F_API FMOD_SoundGroup_GetSound (FMOD_SOUNDGROUP *soundgroup, int index, FMOD_SOUND **sound);
546 | FMOD_RESULT F_API FMOD_SoundGroup_GetNumPlaying (FMOD_SOUNDGROUP *soundgroup, int *numplaying);
547 |
548 | /*
549 | Userdata set/get.
550 | */
551 |
552 | FMOD_RESULT F_API FMOD_SoundGroup_SetUserData (FMOD_SOUNDGROUP *soundgroup, void *userdata);
553 | FMOD_RESULT F_API FMOD_SoundGroup_GetUserData (FMOD_SOUNDGROUP *soundgroup, void **userdata);
554 |
555 | /*
556 | 'DSP' API
557 | */
558 |
559 | FMOD_RESULT F_API FMOD_DSP_Release (FMOD_DSP *dsp);
560 | FMOD_RESULT F_API FMOD_DSP_GetSystemObject (FMOD_DSP *dsp, FMOD_SYSTEM **system);
561 |
562 | /*
563 | Connection / disconnection / input and output enumeration.
564 | */
565 |
566 | FMOD_RESULT F_API FMOD_DSP_AddInput (FMOD_DSP *dsp, FMOD_DSP *input, FMOD_DSPCONNECTION **connection, FMOD_DSPCONNECTION_TYPE type);
567 | FMOD_RESULT F_API FMOD_DSP_DisconnectFrom (FMOD_DSP *dsp, FMOD_DSP *target, FMOD_DSPCONNECTION *connection);
568 | FMOD_RESULT F_API FMOD_DSP_DisconnectAll (FMOD_DSP *dsp, FMOD_BOOL inputs, FMOD_BOOL outputs);
569 | FMOD_RESULT F_API FMOD_DSP_GetNumInputs (FMOD_DSP *dsp, int *numinputs);
570 | FMOD_RESULT F_API FMOD_DSP_GetNumOutputs (FMOD_DSP *dsp, int *numoutputs);
571 | FMOD_RESULT F_API FMOD_DSP_GetInput (FMOD_DSP *dsp, int index, FMOD_DSP **input, FMOD_DSPCONNECTION **inputconnection);
572 | FMOD_RESULT F_API FMOD_DSP_GetOutput (FMOD_DSP *dsp, int index, FMOD_DSP **output, FMOD_DSPCONNECTION **outputconnection);
573 |
574 | /*
575 | DSP unit control.
576 | */
577 |
578 | FMOD_RESULT F_API FMOD_DSP_SetActive (FMOD_DSP *dsp, FMOD_BOOL active);
579 | FMOD_RESULT F_API FMOD_DSP_GetActive (FMOD_DSP *dsp, FMOD_BOOL *active);
580 | FMOD_RESULT F_API FMOD_DSP_SetBypass (FMOD_DSP *dsp, FMOD_BOOL bypass);
581 | FMOD_RESULT F_API FMOD_DSP_GetBypass (FMOD_DSP *dsp, FMOD_BOOL *bypass);
582 | FMOD_RESULT F_API FMOD_DSP_SetWetDryMix (FMOD_DSP *dsp, float prewet, float postwet, float dry);
583 | FMOD_RESULT F_API FMOD_DSP_GetWetDryMix (FMOD_DSP *dsp, float *prewet, float *postwet, float *dry);
584 | FMOD_RESULT F_API FMOD_DSP_SetChannelFormat (FMOD_DSP *dsp, FMOD_CHANNELMASK channelmask, int numchannels, FMOD_SPEAKERMODE source_speakermode);
585 | FMOD_RESULT F_API FMOD_DSP_GetChannelFormat (FMOD_DSP *dsp, FMOD_CHANNELMASK *channelmask, int *numchannels, FMOD_SPEAKERMODE *source_speakermode);
586 | FMOD_RESULT F_API FMOD_DSP_GetOutputChannelFormat (FMOD_DSP *dsp, FMOD_CHANNELMASK inmask, int inchannels, FMOD_SPEAKERMODE inspeakermode, FMOD_CHANNELMASK *outmask, int *outchannels, FMOD_SPEAKERMODE *outspeakermode);
587 | FMOD_RESULT F_API FMOD_DSP_Reset (FMOD_DSP *dsp);
588 |
589 | /*
590 | DSP parameter control.
591 | */
592 |
593 | FMOD_RESULT F_API FMOD_DSP_SetParameterFloat (FMOD_DSP *dsp, int index, float value);
594 | FMOD_RESULT F_API FMOD_DSP_SetParameterInt (FMOD_DSP *dsp, int index, int value);
595 | FMOD_RESULT F_API FMOD_DSP_SetParameterBool (FMOD_DSP *dsp, int index, FMOD_BOOL value);
596 | FMOD_RESULT F_API FMOD_DSP_SetParameterData (FMOD_DSP *dsp, int index, void *data, unsigned int length);
597 | FMOD_RESULT F_API FMOD_DSP_GetParameterFloat (FMOD_DSP *dsp, int index, float *value, char *valuestr, int valuestrlen);
598 | FMOD_RESULT F_API FMOD_DSP_GetParameterInt (FMOD_DSP *dsp, int index, int *value, char *valuestr, int valuestrlen);
599 | FMOD_RESULT F_API FMOD_DSP_GetParameterBool (FMOD_DSP *dsp, int index, FMOD_BOOL *value, char *valuestr, int valuestrlen);
600 | FMOD_RESULT F_API FMOD_DSP_GetParameterData (FMOD_DSP *dsp, int index, void **data, unsigned int *length, char *valuestr, int valuestrlen);
601 | FMOD_RESULT F_API FMOD_DSP_GetNumParameters (FMOD_DSP *dsp, int *numparams);
602 | FMOD_RESULT F_API FMOD_DSP_GetParameterInfo (FMOD_DSP *dsp, int index, FMOD_DSP_PARAMETER_DESC **desc);
603 | FMOD_RESULT F_API FMOD_DSP_GetDataParameterIndex (FMOD_DSP *dsp, int datatype, int *index);
604 | FMOD_RESULT F_API FMOD_DSP_ShowConfigDialog (FMOD_DSP *dsp, void *hwnd, FMOD_BOOL show);
605 |
606 | /*
607 | DSP attributes.
608 | */
609 |
610 | FMOD_RESULT F_API FMOD_DSP_GetInfo (FMOD_DSP *dsp, char *name, unsigned int *version, int *channels, int *configwidth, int *configheight);
611 | FMOD_RESULT F_API FMOD_DSP_GetType (FMOD_DSP *dsp, FMOD_DSP_TYPE *type);
612 | FMOD_RESULT F_API FMOD_DSP_GetIdle (FMOD_DSP *dsp, FMOD_BOOL *idle);
613 |
614 | /*
615 | Userdata set/get.
616 | */
617 |
618 | FMOD_RESULT F_API FMOD_DSP_SetUserData (FMOD_DSP *dsp, void *userdata);
619 | FMOD_RESULT F_API FMOD_DSP_GetUserData (FMOD_DSP *dsp, void **userdata);
620 |
621 | /*
622 | Metering.
623 | */
624 |
625 | FMOD_RESULT F_API FMOD_DSP_SetMeteringEnabled (FMOD_DSP *dsp, FMOD_BOOL inputEnabled, FMOD_BOOL outputEnabled);
626 | FMOD_RESULT F_API FMOD_DSP_GetMeteringEnabled (FMOD_DSP *dsp, FMOD_BOOL *inputEnabled, FMOD_BOOL *outputEnabled);
627 | FMOD_RESULT F_API FMOD_DSP_GetMeteringInfo (FMOD_DSP *dsp, FMOD_DSP_METERING_INFO *inputInfo, FMOD_DSP_METERING_INFO *outputInfo);
628 |
629 | /*
630 | 'DSPConnection' API
631 | */
632 |
633 | FMOD_RESULT F_API FMOD_DSPConnection_GetInput (FMOD_DSPCONNECTION *dspconnection, FMOD_DSP **input);
634 | FMOD_RESULT F_API FMOD_DSPConnection_GetOutput (FMOD_DSPCONNECTION *dspconnection, FMOD_DSP **output);
635 | FMOD_RESULT F_API FMOD_DSPConnection_SetMix (FMOD_DSPCONNECTION *dspconnection, float volume);
636 | FMOD_RESULT F_API FMOD_DSPConnection_GetMix (FMOD_DSPCONNECTION *dspconnection, float *volume);
637 | FMOD_RESULT F_API FMOD_DSPConnection_SetMixMatrix (FMOD_DSPCONNECTION *dspconnection, float *matrix, int outchannels, int inchannels, int inchannel_hop);
638 | FMOD_RESULT F_API FMOD_DSPConnection_GetMixMatrix (FMOD_DSPCONNECTION *dspconnection, float *matrix, int *outchannels, int *inchannels, int inchannel_hop);
639 | FMOD_RESULT F_API FMOD_DSPConnection_GetType (FMOD_DSPCONNECTION *dspconnection, FMOD_DSPCONNECTION_TYPE *type);
640 |
641 | /*
642 | Userdata set/get.
643 | */
644 |
645 | FMOD_RESULT F_API FMOD_DSPConnection_SetUserData (FMOD_DSPCONNECTION *dspconnection, void *userdata);
646 | FMOD_RESULT F_API FMOD_DSPConnection_GetUserData (FMOD_DSPCONNECTION *dspconnection, void **userdata);
647 |
648 | /*
649 | 'Geometry' API
650 | */
651 |
652 | FMOD_RESULT F_API FMOD_Geometry_Release (FMOD_GEOMETRY *geometry);
653 |
654 | /*
655 | Polygon manipulation.
656 | */
657 |
658 | FMOD_RESULT F_API FMOD_Geometry_AddPolygon (FMOD_GEOMETRY *geometry, float directocclusion, float reverbocclusion, FMOD_BOOL doublesided, int numvertices, const FMOD_VECTOR *vertices, int *polygonindex);
659 | FMOD_RESULT F_API FMOD_Geometry_GetNumPolygons (FMOD_GEOMETRY *geometry, int *numpolygons);
660 | FMOD_RESULT F_API FMOD_Geometry_GetMaxPolygons (FMOD_GEOMETRY *geometry, int *maxpolygons, int *maxvertices);
661 | FMOD_RESULT F_API FMOD_Geometry_GetPolygonNumVertices (FMOD_GEOMETRY *geometry, int index, int *numvertices);
662 | FMOD_RESULT F_API FMOD_Geometry_SetPolygonVertex (FMOD_GEOMETRY *geometry, int index, int vertexindex, const FMOD_VECTOR *vertex);
663 | FMOD_RESULT F_API FMOD_Geometry_GetPolygonVertex (FMOD_GEOMETRY *geometry, int index, int vertexindex, FMOD_VECTOR *vertex);
664 | FMOD_RESULT F_API FMOD_Geometry_SetPolygonAttributes (FMOD_GEOMETRY *geometry, int index, float directocclusion, float reverbocclusion, FMOD_BOOL doublesided);
665 | FMOD_RESULT F_API FMOD_Geometry_GetPolygonAttributes (FMOD_GEOMETRY *geometry, int index, float *directocclusion, float *reverbocclusion, FMOD_BOOL *doublesided);
666 |
667 | /*
668 | Object manipulation.
669 | */
670 |
671 | FMOD_RESULT F_API FMOD_Geometry_SetActive (FMOD_GEOMETRY *geometry, FMOD_BOOL active);
672 | FMOD_RESULT F_API FMOD_Geometry_GetActive (FMOD_GEOMETRY *geometry, FMOD_BOOL *active);
673 | FMOD_RESULT F_API FMOD_Geometry_SetRotation (FMOD_GEOMETRY *geometry, const FMOD_VECTOR *forward, const FMOD_VECTOR *up);
674 | FMOD_RESULT F_API FMOD_Geometry_GetRotation (FMOD_GEOMETRY *geometry, FMOD_VECTOR *forward, FMOD_VECTOR *up);
675 | FMOD_RESULT F_API FMOD_Geometry_SetPosition (FMOD_GEOMETRY *geometry, const FMOD_VECTOR *position);
676 | FMOD_RESULT F_API FMOD_Geometry_GetPosition (FMOD_GEOMETRY *geometry, FMOD_VECTOR *position);
677 | FMOD_RESULT F_API FMOD_Geometry_SetScale (FMOD_GEOMETRY *geometry, const FMOD_VECTOR *scale);
678 | FMOD_RESULT F_API FMOD_Geometry_GetScale (FMOD_GEOMETRY *geometry, FMOD_VECTOR *scale);
679 | FMOD_RESULT F_API FMOD_Geometry_Save (FMOD_GEOMETRY *geometry, void *data, int *datasize);
680 |
681 | /*
682 | Userdata set/get.
683 | */
684 |
685 | FMOD_RESULT F_API FMOD_Geometry_SetUserData (FMOD_GEOMETRY *geometry, void *userdata);
686 | FMOD_RESULT F_API FMOD_Geometry_GetUserData (FMOD_GEOMETRY *geometry, void **userdata);
687 |
688 | /*
689 | 'Reverb3D' API
690 | */
691 |
692 | FMOD_RESULT F_API FMOD_Reverb3D_Release (FMOD_REVERB3D *reverb3d);
693 |
694 | /*
695 | Reverb manipulation.
696 | */
697 |
698 | FMOD_RESULT F_API FMOD_Reverb3D_Set3DAttributes (FMOD_REVERB3D *reverb3d, const FMOD_VECTOR *position, float mindistance, float maxdistance);
699 | FMOD_RESULT F_API FMOD_Reverb3D_Get3DAttributes (FMOD_REVERB3D *reverb3d, FMOD_VECTOR *position, float *mindistance, float *maxdistance);
700 | FMOD_RESULT F_API FMOD_Reverb3D_SetProperties (FMOD_REVERB3D *reverb3d, const FMOD_REVERB_PROPERTIES *properties);
701 | FMOD_RESULT F_API FMOD_Reverb3D_GetProperties (FMOD_REVERB3D *reverb3d, FMOD_REVERB_PROPERTIES *properties);
702 | FMOD_RESULT F_API FMOD_Reverb3D_SetActive (FMOD_REVERB3D *reverb3d, FMOD_BOOL active);
703 | FMOD_RESULT F_API FMOD_Reverb3D_GetActive (FMOD_REVERB3D *reverb3d, FMOD_BOOL *active);
704 |
705 | /*
706 | Userdata set/get.
707 | */
708 |
709 | FMOD_RESULT F_API FMOD_Reverb3D_SetUserData (FMOD_REVERB3D *reverb3d, void *userdata);
710 | FMOD_RESULT F_API FMOD_Reverb3D_GetUserData (FMOD_REVERB3D *reverb3d, void **userdata);
711 |
712 | /*$ preserve start $*/
713 |
714 | #ifdef __cplusplus
715 | }
716 | #endif
717 |
718 | #endif /* _FMOD_H */
719 |
720 | /*$ preserve end $*/
721 |
--------------------------------------------------------------------------------