Skip to content

Commit a9286f0

Browse files
committedMay 25, 2020
1 parent 433c26d commit a9286f0

29 files changed

+4279
-29
lines changed
 

‎.gitignore

-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
# FMOD library directories
2-
lib/api/*
3-
lib/bin/*
4-
lib/doc/*
5-
61
# Editor files
72
/.vscode/
83
/example-project/EZPlatformer/.vscode/

‎README.md

+1-13
Original file line numberDiff line numberDiff line change
@@ -58,18 +58,6 @@ After configuring your project to work with this library, playing a song or soun
5858

5959
This will be the tool you use to manage all audio for your game. Download FMOD Studio version 2.00.08 [here](https://tanneris.me/fmod-downloads). Once installed, follow the [FMOD Studio Project Configuration](#fmod-studio-project-configuration) section before moving on.
6060

61-
**Download the FMOD API:**
62-
63-
To run FMOD in your game, you need get FMOD Studio API version 2.00.08. You will have to download the Windows integration and HTML5 integration separately. The Windows API will be installed and the HTML5 API will come in a zip. They can both be found [here](https://tanneris.me/fmod-downloads) under the "FMOD Studio" dropdown.
64-
65-
Windows:
66-
67-
Once installed, find the `FMOD Studio API Windows` folder in the FMOD Studio API's installation directory. Take the entire `api` folder and copy it into the `lib/Windows` directory of the `haxefmod` library. If you installed this library using `haxelib`, you can find the location of the library on your computer by running `haxelib config`. Once the `api` folder is copied into the `haxefmod` project, the path to the API folder should look like this: `haxefmod/lib/Windows/api`.
68-
69-
HTML5:
70-
71-
The HTML5 API will come in the form of a zip folder. Unzip it and move the `api` folder into `haxefmod/lib/html5` similarly to the process of installing the Windows API.
72-
7361
**Add the library your Haxe project:**
7462

7563
[Download the package via Haxelib](https://tanneris.me/haxelib)
@@ -107,7 +95,7 @@ DebugMessages //Bool: Enables console output for internal FMOD API calls (can be
10795

10896
## HTML5 Builds
10997

110-
For HTML5 builds to work, a dedicated scene must be run before the game starts to give the FMOD engine a chance to fully load. See the [EZPlatformer example project](./example-project/EZPlatformer/source) for a demonstration of how to handle this. The `Main.hx` file loads the startup scene, waits for FMOD to initialize, then starts the game.
98+
For HTML5 builds to work, a dedicated scene must be run before the game starts to give the FMOD engine a chance to fully load. See the [EZPlatformer example project](./example-project/EZPlatformer/source) for a demonstration of how to handle this. The `Main.hx` file loads the startup scene, the startup scene initializes FMOD and waits for it to report back as initialized, then the game is started.
11199

112100
## FMOD Studio Project Configuration
113101

‎faxe/linc_faxe.xml

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
<files id="haxe">
2323
<compilerflag value="-I${LINC_FAXE_PATH}faxe/" />
2424
<compilerflag value="-I${NATIVE_TOOLKIT_PATH}/api/core/inc/" />
25-
<compilerflag value="-I${NATIVE_TOOLKIT_PATH}/api/fsbank/inc/" />
2625
<compilerflag value="-I${NATIVE_TOOLKIT_PATH}/api/studio/inc/" />
2726

2827
<!-- Additional linux compiler flags

‎include.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<dependency name="lib/Windows/api/core/lib/x64/fmod.dll" if="windows" unless="HXCPP_M32"/>
99
<dependency name="lib/Windows/api/studio/lib/x64/fmodstudio.dll" if="windows" unless="HXCPP_M32"/>
1010

11-
<dependency path="lib/html5/api/studio/lib/wasm/fmodstudio.js" if="html5"/>
12-
<assets path="lib/html5/api/studio/lib/wasm/fmodstudio.wasm" rename="lib/fmodstudio.wasm" if="html5"/>
11+
<dependency path="lib/html5/fmodstudio.js" if="html5"/>
12+
<assets path="lib/html5/fmodstudio.wasm" rename="lib/fmodstudio.wasm" if="html5"/>
1313
<dependency path="jaxe/jaxe.js" if="html5"/>
1414
</project>

‎lib/Windows/.gitignore

-4
This file was deleted.

‎lib/Windows/api/core/inc/fmod.h

+665
Large diffs are not rendered by default.

‎lib/Windows/api/core/inc/fmod.hpp

+604
Large diffs are not rendered by default.

‎lib/Windows/api/core/inc/fmod_codec.h

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
/* ======================================================================================== */
2+
/* FMOD Core API - Codec development header file. */
3+
/* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2020. */
4+
/* */
5+
/* Use this header if you are wanting to develop your own file format plugin to use with */
6+
/* FMOD's codec system. With this header you can make your own fileformat plugin that FMOD */
7+
/* can register and use. See the documentation and examples on how to make a working */
8+
/* plugin. */
9+
/* */
10+
/* For more detail visit: */
11+
/* https://fmod.com/resources/documentation-api?version=2.0&page=core-api.html */
12+
/* ======================================================================================== */
13+
#ifndef _FMOD_CODEC_H
14+
#define _FMOD_CODEC_H
15+
16+
/*
17+
Codec types
18+
*/
19+
typedef struct FMOD_CODEC_STATE FMOD_CODEC_STATE;
20+
typedef struct FMOD_CODEC_WAVEFORMAT FMOD_CODEC_WAVEFORMAT;
21+
22+
/*
23+
Codec constants
24+
*/
25+
#define FMOD_CODEC_WAVEFORMAT_VERSION 3
26+
27+
/*
28+
Codec callbacks
29+
*/
30+
typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_OPEN_CALLBACK) (FMOD_CODEC_STATE *codec_state, FMOD_MODE usermode, FMOD_CREATESOUNDEXINFO *userexinfo);
31+
typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_CLOSE_CALLBACK) (FMOD_CODEC_STATE *codec_state);
32+
typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_READ_CALLBACK) (FMOD_CODEC_STATE *codec_state, void *buffer, unsigned int samples_in, unsigned int *samples_out);
33+
typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_GETLENGTH_CALLBACK) (FMOD_CODEC_STATE *codec_state, unsigned int *length, FMOD_TIMEUNIT lengthtype);
34+
typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_SETPOSITION_CALLBACK) (FMOD_CODEC_STATE *codec_state, int subsound, unsigned int position, FMOD_TIMEUNIT postype);
35+
typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_GETPOSITION_CALLBACK) (FMOD_CODEC_STATE *codec_state, unsigned int *position, FMOD_TIMEUNIT postype);
36+
typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_SOUNDCREATE_CALLBACK) (FMOD_CODEC_STATE *codec_state, int subsound, FMOD_SOUND *sound);
37+
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);
38+
typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_GETWAVEFORMAT_CALLBACK)(FMOD_CODEC_STATE *codec_state, int index, FMOD_CODEC_WAVEFORMAT *waveformat);
39+
40+
/*
41+
Codec structures
42+
*/
43+
typedef struct FMOD_CODEC_DESCRIPTION
44+
{
45+
const char *name;
46+
unsigned int version;
47+
int defaultasstream;
48+
FMOD_TIMEUNIT timeunits;
49+
FMOD_CODEC_OPEN_CALLBACK open;
50+
FMOD_CODEC_CLOSE_CALLBACK close;
51+
FMOD_CODEC_READ_CALLBACK read;
52+
FMOD_CODEC_GETLENGTH_CALLBACK getlength;
53+
FMOD_CODEC_SETPOSITION_CALLBACK setposition;
54+
FMOD_CODEC_GETPOSITION_CALLBACK getposition;
55+
FMOD_CODEC_SOUNDCREATE_CALLBACK soundcreate;
56+
FMOD_CODEC_GETWAVEFORMAT_CALLBACK getwaveformat;
57+
} FMOD_CODEC_DESCRIPTION;
58+
59+
struct FMOD_CODEC_WAVEFORMAT
60+
{
61+
const char* name;
62+
FMOD_SOUND_FORMAT format;
63+
int channels;
64+
int frequency;
65+
unsigned int lengthbytes;
66+
unsigned int lengthpcm;
67+
unsigned int pcmblocksize;
68+
int loopstart;
69+
int loopend;
70+
FMOD_MODE mode;
71+
FMOD_CHANNELMASK channelmask;
72+
FMOD_CHANNELORDER channelorder;
73+
float peakvolume;
74+
};
75+
76+
struct FMOD_CODEC_STATE
77+
{
78+
int numsubsounds;
79+
FMOD_CODEC_WAVEFORMAT *waveformat;
80+
void *plugindata;
81+
82+
void *filehandle;
83+
unsigned int filesize;
84+
FMOD_FILE_READ_CALLBACK fileread;
85+
FMOD_FILE_SEEK_CALLBACK fileseek;
86+
FMOD_CODEC_METADATA_CALLBACK metadata;
87+
88+
int waveformatversion;
89+
};
90+
91+
#endif
92+
93+

0 commit comments

Comments
 (0)
Please sign in to comment.