Fork me on GitHub

RPG Maker API

One of the generated glue interfaces for SoLoud is the RPG Maker API. Since RPG Maker uses Ruby, this API is equal to the Ruby API.

All of the existing interfaces can be used via the Ruby API, but features that require extending SoLoud are not available.

Using the RPG Maker API

The glue file rpgmaker_soloud.rb can be found under the "glue" directory.

Copy the contents of rpgmaker_soloud.rb into one RPG Maker script tab, drop the "soloud_x86.dll" in your project's System folder and just use it.

RPG Maker API Example

The RPG Maker Ruby API mirrors the c++ API.

If the c++ API functions have default parameters, the same function in the ruby API will also have default parameters.

As an example, here's a simple example in the C++ api:


SoLoud::Soloud soloud;
SoLoud::Speech speech;

speech.setText("Hello c++ api");

soloud.init(SoLoud::Soloud::CLIP_ROUNDOFF |
            SoLoud::Soloud::ENABLE_VISUALIZATION)

soloud.setGlobalVolume(4);
soloud.play(speech);

// ...

soloud.deinit();

Converted to the RPG Maker API, this becomes:


soloud=SoLoud::Soloud.new
speech=SoLoud::Speech.new

speech.set_text("Hello Ruby api")

soloud.init(SoLoud::Soloud::CLIP_ROUNDOFF | 
            SoLoud::Soloud::ENABLE_VISUALIZATION)

soloud.set_global_volume(4)
soloud.play(speech)

# ...

soloud.deinit()
speech.destroy()
soloud.destroy()

Copyright©2013-2020 Jari Komppa