How to add music to an effect?

  1. We recommend using .ogg as both Android and iOS have no issues playing this audio format.

  2. After you have your audio file ready, you need to place it into a subfolder of the effect called “audios”.

  3. You need to open the config.json of the effect you want to add music to and declare the audio file there as a media type of audio according to the below example:



    Important: make sure you set the filename to match that of your audio file

  4. in the config.js of the effect you need to declare the following object: const audio = bnb.scene.getAssetManager().findAudioTrack(“name”).asMedia()

    Important: make sure you set “name” in the line above to match that of your audio file

  5. You can then use these methods in the config.js to further configure it: