예제 #1
0
 /// <summary>
 /// Creates a new factory initialized with variable volume and pitch for
 /// a 3D voice.
 /// </summary>
 /// <param name="volume">
 /// The volume of the audio. A variation of 0.1f will be applied to it.
 /// </param>
 /// <param name="pitch">
 /// The pitch of the audio. A variation of 0.1f will be applied to it.
 /// </param>
 /// <returns>The factory to modify.</returns>
 public static Factory Variable3D(float volume = 0.9f, float pitch = 1)
 {
     return(new Factory()
            .Volume(FloatVariance.Variance(volume, 0.1f))
            .Pitch(FloatVariance.Variance(pitch, 0.1f))
            .SpatialBlend(FloatVariance.Const(1)));
 }
예제 #2
0
 internal Factory(TransientParams p = null)
 {
     volume              = p?.volume ?? FloatVariance.Range(0.8f, 1.0f);
     pitch               = p?.pitch ?? FloatVariance.Variance(1.0f, 0.1f);
     normalizedTime      = p?.normalizedTime ?? FloatVariance.Const(0.0f);
     leftSilencePadding  = p?.leftSilencePadding ?? FloatVariance.Const(0.0f);
     rightSilencePadding = p?.rightSilencePadding ?? FloatVariance.Const(0.0f);
     panStereo           = p?.panStereo ?? FloatVariance.Const(0.0f);
     spatialBlend        = p?.spatialBlend ?? FloatVariance.Const(0.0f);
     mixerGroup          = p?.mixerGroup;
 }