Skip to content

Commit 581ee07

Browse files
committed
Release 0.1.3
- Linux build & run support - Modularize and cleanup build script - Vorbis playback support - Cargo features for static linking of Wwise plugins - Fix unsafe memory accesses when converting to AkOsChar* and char* - Example refactored to be platform agnostic - Example demonstrates static/dynamic plugin registration for Vorbis compression (static), AkMeterFX (static) and AkRoomVerbFX (dynamic)
1 parent be7ee69 commit 581ee07

20 files changed

+1021
-299
lines changed

Cargo.toml

+39-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rrise"
3-
version = "0.1.0"
3+
version = "0.1.3"
44
edition = "2018"
55
authors = ["David Taralla <davidtaralla@gmail.com> & Contributors to the Rrise project"]
66
description = "A rust binding for Wwise"
@@ -13,19 +13,53 @@ license-file = "LICENSE"
1313

1414
[dependencies]
1515
ctrlc = { version = "3.2.1", optional = true }
16+
simple_logger = { version = "2.1.0", optional = true }
17+
paste = "1.0.7"
18+
log = "0.4.16"
1619

1720
[build-dependencies]
1821
bindgen = "0.59.2"
1922
cc = "1.0.73"
23+
paste = "1.0.7"
2024

2125
[target.'cfg(windows)'.build-dependencies.winreg]
2226
version = "0.10.1"
2327

24-
[[example]]
25-
name = "windows_sample"
26-
required-features = ["ctrlc"]
27-
2828
[lib]
2929
name = "rrise"
3030
path = "src/rrise.rs"
3131
crate-type = ["dylib", "rlib"]
32+
33+
[features]
34+
default = ["AkVorbisDecoder", "AkMeterFX"]
35+
AkVorbisDecoder = []
36+
AkOpusDecoder = ["AkOggOpusDecoder", "AkWemOpusDecoder"] # KNOWN LIMITATION: link error if you use it
37+
AkAudioInputSource = []
38+
AkCompressorFX = []
39+
AkDelayFX = []
40+
AkExpanderFX = []
41+
AkFlangerFX = []
42+
AkGainFX = []
43+
AkGuitarDistortionFX = []
44+
AkHarmonizerFX = []
45+
AkMatrixReverbFX = []
46+
AkMeterFX = []
47+
AkParametricEQFX = []
48+
AkPeakLimiterFX = []
49+
AkPitchShifterFX = []
50+
AkRecorderFX = []
51+
AkRoomVerbFX = []
52+
AkSilenceSource = []
53+
AkSineSource = []
54+
AkStereoDelayFX = []
55+
AkSynthOneSource = []
56+
AkTimeStretchFX = []
57+
AkToneSource = []
58+
AkTremoloFX = []
59+
# Internal features, don't enable independantly!
60+
AkOggOpusDecoder = []
61+
AkWemOpusDecoder = []
62+
63+
[[example]]
64+
name = "looping_event"
65+
required-features = ["ctrlc", "simple_logger"]

README.md

+77-14
Original file line numberDiff line numberDiff line change
@@ -18,32 +18,94 @@ or architectural choices, please reach out to improve the crate!
1818

1919
Pull requests are more than welcome: **they are encouraged**!
2020

21-
## Features
22-
Currently, this crate can do very little, and only on Windows platforms:
23-
- Windows 10+ support
24-
- Initialize/Update/Terminate a minimal sound engine
21+
## Capabilities
22+
- Build & run on Windows 10+
23+
- Build & run on WSL/Linux (on distros where Wwise is supported)
24+
- (AD)PCM & Vorbis playback
25+
- Initialize/Update/Terminate a sound engine
2526
- Post simple events (no callback/external source support yet)
2627
- Default streaming manager leveraging Wwise's sample streaming manager
27-
- Profiling from the Wwise authoring tool.
28-
- Minimal example showcasing how to initialize the sound engine, interact with it and terminate it.
28+
- Profiling from the Wwise authoring tool
29+
- Minimal example showcasing how to initialize the sound engine, post an event and terminate it
30+
- Dynamic & static linking of Wwise plugins through cargo features
31+
32+
### Logging
33+
Rrise uses the [log](https://docs.rs/log/latest/log/index.html) crate for all its logging needs. Refer to `log`'s
34+
docs for how to use it.
35+
36+
The provided `looping_event` example installs a [simple_log](https://docs.rs/simple_logger) to get Rrise logs to
37+
display in the console.
38+
39+
### Wwise Plugins
40+
You can [choose](https://www.audiokinetic.com/library/edge/?source=SDK&id=soundengine_integration_plugins.html) to
41+
either link statically or dynamically to the Wwise plugins.
42+
43+
Note that some plugins like _AkMeter_ can only be statically linked and are not available for dynamic linking.
44+
45+
See [this page](https://www.audiokinetic.com/library/edge/?source=SDK&id=goingfurther_builds.html#wwise_sdk_lib_dependency_requirements_plugins)
46+
for a list of plugins supported by Wwise, per platform.
47+
48+
#### Dynamic linking
49+
This is the default behavior. Wwise plugins like _AkRoomVerb_, _AkMeter_, _Motion_ etc. will be loaded at runtime from
50+
their respective shared library as needed.
51+
52+
Any project relying on dynamic linking for some plugins needs to also deploy their respective *licensed* shared
53+
libraries along the final executable (you can do this with a
54+
[build script](https://doc.rust-lang.org/cargo/reference/build-scripts.html) for instance).
55+
56+
You can find these shared libraries in `$WWISESDK/[platform]/[config]/bin`.
57+
58+
#### Static linking
59+
You might want to statically link some Wwise plugins instead of loading them at runtime from a shared libary. In
60+
this case, you can leverage Rrise's cargo features to enable static linking of such plugins.
61+
62+
For example, if you want to statically link the _AkRoomVerb_ plugin, just build with the `AkRoomVerbFX` feature
63+
enabled. When your project runs, you can check that the static version of the plugin was loaded in the debug log:
64+
```
65+
AkRoomVerbFX has been statically loaded successfully
66+
```
67+
**Note:** If you already built your project once, you need to make Rrise's build script rerun to enable static
68+
linking of your features. You can change the value of the `RRISE_RERUN_BUILD` environment variable before building to
69+
force a rerun of Rrise's build script. You can also force a full rebuild with `cargo clean & cargo build
70+
--features=The,Plugin,List`.
71+
72+
### Known issues & limitations
73+
- Issue when linking AkOpusDecoder: Opus is currently unavailable.
74+
- `wwconfig` cfg flag doesn't seem to be forwarded to the build scripts?
75+
- If you dynamically link Wwise effect plugins (default behavior), there is an issue on Windows where if the path given
76+
to `AkInitSettings::with_plugin_dll_path` contains spaces, the DLLs in that folder won't be discoverable by Wwise.
77+
- On Linux, when connecting the profiler, you will get those messages in the console (they seem totally harmless):
78+
```
79+
.../SDK/Linux_x64/Profile/bin/libDefaultConversions.so: cannot open shared object file: No such file or directory
80+
.../SDK/Linux_x64/Profile/bin/libAkSoundEngineDLL.so: cannot open shared object file: No such file or directory
81+
```
2982

3083
## Requirements
84+
- The `bindgen` crate [requirements](https://github.com/rust-lang/rust-bindgen/blob/master/book/src/requirements.md)
3185
- A licensed (free, trial, commercial,...) version of Wwise installed
3286
- Wwise itself
3387
- Wwise SDK (C++)
34-
- Wwise support for any Visual Studio 20XX deployment platform
35-
- Make sure the `WWISESDK` environment is set to the SDK folder of your Wwise installation
36-
- MSVC[^1]
88+
- **On Windows: `MSVC`**[^1]
3789
- Windows 10 SDK
3890
- Build tools (same as Rust, for the `cc` crate)
39-
- `cl.exe` must be in the PATH (current limitation of the build script)
40-
- The `bindgen` crate [requirements](https://github.com/rust-lang/rust-bindgen/blob/master/book/src/requirements.md)
91+
- `cl.exe` must be in the PATH[^2]
92+
- Wwise support for any Visual Studio 20XX deployment platform
93+
- Make sure the `WWISESDK` environment variable is set to the SDK folder of your Wwise installation
94+
- **On Linux: `clang`**
95+
- `g++` (for `libstdc++`)
96+
- Copy the SDK folder from a Windows[^3] install of Wwise on your Linux workstation (for instance in /opt/wwise)
97+
- Make sure the `WWISESDK` environment variable is set to that folder
98+
4199
[^1]: Not tested on other compilers like MinGW or Clang
100+
[^2]: Current limitation of the build script. I want to improve MSVC path discovery in the future to remove this
101+
requirement.
102+
[^3]: AudioKinetic doesn't provide direct downloads to their SDK: you can only install it through their launcher.
103+
However, this launcher being only available on Windows and MacOS, you'll need to install it on a VM or similar before
104+
you can work with this crate on Linux.
42105

43106
## Short-term roadmap
44-
- Add support for Linux/WSL
107+
- Make Opus playback available
45108
- Spatial module basic API and example
46-
- Modularize with features (especially profiling)
47109
- Add callback and user data support for PostEvent
48110
- Review/Improve architecture
49111

@@ -52,4 +114,5 @@ Wwise and the Wwise logo are trademarks of Audiokinetic Inc., registered in the
52114

53115
This project is in no way affiliated to Audiokinetic.
54116

55-
You still need a licensed version of Wwise installed to compile and run this project.
117+
You still need a licensed version of Wwise installed to compile and run this project. You need a valid Wwise license
118+
to distribute any project based on this crate.

0 commit comments

Comments
 (0)