Solved playSound() volume and pitch ranges ?

Discussion in 'Plugin Development' started by Digi, Mar 1, 2013.

Thread Status:
Not open for further replies.
  1. I've searched about this and didn't get a concrete answer of the exact limits.

    I'm interested in playSound()'s limits for volume argument, what values can I safely use that also have an actual effect ?

    I'm asking because I'm providing server admins with the ability to change these values so I want to tell them what are the acceptable values.

    EDIT:
    I've found pitch limits in CB code:
    CB code (open)
    Code:
      public Packet62NamedSoundEffect(String paramString, double paramDouble1, double paramDouble2, double paramDouble3, float paramFloat1, float paramFloat2)
      {
        a = paramString;
        b = (int)(paramDouble1 * 8.0D);
        c = (int)(paramDouble2 * 8.0D);
        d = (int)(paramDouble3 * 8.0D);
        e = paramFloat1;
        f = (int)(paramFloat2 * 63.0F);
    
        if (f < 0) f = 0;
        if (f > 255) f = 255;
      }

    Apparently pitch is multiplied by 63 then limited to 0-255... so that's like 0-4.

    The volume doesn't seem to be limited by anything, anyone have an idea what valid arguments you can have for volume ?
     
  2. Offline

    blablubbabc

    Some guess from me would be:
    volume from 0.0 - 1.0 and pitch from 0.0 - 2.0

    This is a guess. :D
     
  3. I can guess too, I don't need guesses :p

    Well, I'm just gonna test for myself then, this plugin is gonna take forever to make at this pace...

    EDIT: yeah, tested, volume only makes a diference between 0.0 and 1.0, setting it higher is valid but has no effect.
     
Thread Status:
Not open for further replies.

Share This Page