/SoundAPI

A API which it making sound easily and simple!

Primary LanguagePHPGNU General Public License v3.0GPL-3.0

SoundAPI

A API which it making sound easily and simple for PocketMine API4!

How to use this plugin?

Simplified coding as easier on your plugin that you are develop it!

API

Add sound/Stop sound on your plugin

First of all, to add your sound, you need to import SoundAPI class like this:

use SunshroomChan/SoundAPI/SoundAPI;
  • Add sound
    To add custom sound so you just doing this:
SoundAPI::getInstance()->addSound($player, 'what sound if you want', $pitch = random nunber, $volume);

Example:

SoundAPI::getInstance()->addSound($player, 'note.hat' <= this sound you can get it on internet, 1 <= this number is sound pitch, 4 <==== this number is volume of the sound);
  • Stop sound
    If you want to stop sound, just easily doing this:
SoundAPI::getInstance()->stopSound($player, 'same as add sound', true(false) <= it use for stop all sound);