Any suggestions for best way to load small sound effects?

  • Java
    SoundAsset soundfile = SoundAsset.loadFromFile(getPath() + "/assets/warp.mp3");
    player.playSound(soundfile);

    Yahgiggle Steam Signature, real name Deon Hamilton :thumbsup: Server @ ip 139.99.136.76:4255 Name (The Federation of territory) Unity :thumbsup:

    If at first your code does not work call it version 0.1 with the odd bug :thinking:

    My Own Website




    31245-logo-png
  • Java
    SoundAsset soundfile = SoundAsset.loadFromFile(getPath() + "/assets/warp.mp3");
    player.playSound(soundfile);

    You make that file directory in the build or in the plugin directory on the server? If I would guess, you put that in the Plugin directory as just a plain file. I read one of the methods used a jar file so it confused me a bit as to the best choice.


    going to use your suggestion thanks.

  • You make that file directory in the build or in the plugin directory on the server? If I would guess, you put that in the Plugin directory as just a plain file. I read one of the methods used a jar file so it confused me a bit as to the best choice.


    going to use your suggestion thanks.

    you don't really need the assets folder but I like to have them, yes the files should go into the plugin folder, as long as the right path is set the folder does not matter

    Yahgiggle Steam Signature, real name Deon Hamilton :thumbsup: Server @ ip 139.99.136.76:4255 Name (The Federation of territory) Unity :thumbsup:

    If at first your code does not work call it version 0.1 with the odd bug :thinking:

    My Own Website




    31245-logo-png

Participate now!

Don’t have an account yet? Create a new account now and be part of our community!