0
0

hello there dudes

ok heres it is :) i dont have the new version of fmod ported to java yet so this is just a question for the last version.. i will update soon as i can.

i am using 3d audio over streams- all works sweet! but now i would like to add a way of having something like MinMaxDistance. but in the way the summary covers. What 3D_SetMinMaxDistance (in the newer fmod) does not do :)

[quote:2gs5f5b1]Some people have the confusion that maxdistance is the point the sound will fade out to, this is not the case.[/quote:2gs5f5b1]

i would like to do this-. have a radius where the inner area is always set to the max volume value. and then a second bigger raduis is where the space between the two radiuses is the crossfade to 0.

any ideas on this? is it just some setting some place else with a different name?

tops

aNthony

  • You must to post comments
0
0

so to do it for each stream i would have to just set the volume and have no rolloff at all? i no sound in the realworld wouldnt fade out at different times- but hay im not making the realworld.. more fun that way :).

take it i can set the volume of each stream and the rolloff to 0. the volume would still change when i set it in realtime regardless of the rolloff being set? rolloff isent going to overide my volume settings? then i can just use the cool panning 3d stuff in fmod…

sweet? or is there a neater way….

  • You must to post comments
0
0

will this work with streams also dude 😉 ?

  • You must to post comments
0
0

so no win32 :( downer… gurrr!!!

  • You must to post comments
0
0

brett dude how do i get fmod to use software? and not hardware so i can try out the max min the way u saying?

top stufff.. win32 action..

  • You must to post comments
0
0

thats what i thought… ok i give up– heres me code. nice and simple. anyone wnat to tell me were im being a muppet?

[code:1aejdl7b]
package ant.xith3d.mod.testsound;

import java.io.*;
import Music.FmodAPI.*;
//import com.onion.jfmod.*;
import ant.xith3d.mod.Building;

public class test {
float INTERFACE_UPDATETIME = 0.0166667f;

int channel[];
FSOUND_STREAM stream[];

public test() {
try {
init();
} catch (Exception e) {
System.exit(1);
}
}

public void init() {
channel = new int[20];
stream = new FSOUND_STREAM[20];

NativeFmod.FSOUND_SetOutput(NativeFmod.FSOUND_OUTPUT_DSOUND);
NativeFmod.FSOUND_SetDriver(1);
NativeFmod.FSOUND_SetMixer(NativeFmod.FSOUND_MIXER_AUTODETECT);
NativeFmod.FSOUND_Init(32000, 64, 0);
//NativeFmod.FSOUND_3D_SetDistanceFactor(50f);
NativeFmod.FSOUND_3D_SetRolloffFactor(0f);

}

public void loadFile(Building build) {
stream[build.buildingID] = NativeFmod.FSOUND_Stream_Open(build.bSoundName, NativeFmod.FSOUND_NORMAL | NativeFmod.FSOUND_FORCEMONO, 0, 0);
System.out.println(build.buildingID + " stream[i]: " + stream[build.buildingID]);

NativeFmod.FSOUND_Stream_SetMode(stream[build.buildingID], NativeFmod.FSOUND_LOOP_NORMAL);
NativeFmod.FSOUND_3D_SetMinMaxDistance(channel[build.buildingID], 1f, 2f); // should be a fast fade my guess
System.out.println("sound file loaded");

}

public void play(Building build) {
System.out.println("trying to play: " + build + " stream: " + stream[build.buildingID]);
NativeFmod.FSOUND_Stream_Play(NativeFmod.FSOUND_FREE, stream[build.buildingID]);
NativeFmod.FSOUND_SetPaused(channel[build.buildingID], false);
System.out.println("playing....");
}

public void setListenerLocation(float x, float y, float z, float f) {
float[] cam = {y, x, z};
float[] val = {0f, 0f, 0f};
float forward = (float)Math.toRadians(f);
CFloatArray cfa = new CFloatArray(cam);
CFloatArray cval = new CFloatArray(val);
NativeFmod.FSOUND_3D_Listener_SetAttributes(cfa, cval, 0f, 0f, 1f, forward, 0f, 0f);
NativeFmod.FSOUND_Update();
}

public void setSoundLoaction(int chan, float x, float y, float z) {
try {
System.out.println("new building added");
float[] buld = {y, x, z};
float[] val = {0f, 0f, 0f};
CFloatArray cbuld = new CFloatArray(buld);
CFloatArray cval = new CFloatArray(val);

 NativeFmod.FSOUND_3D_SetAttributes(channel[chan], cbuld, cval);
 NativeFmod.FSOUND_Update();

} catch (Exception ex) {
System.out.println("cant do fmod: " + ex.toString());
ex.printStackTrace();
}
}
}
[/code:1aejdl7b][/code]

  • You must to post comments
0
0

yer few things i need to mess with :)
reading up on the Listener (not much docs online).

just been working out the max-min the way i want it by setting the volume on a channel. seems to work ok. lisstener is tricky mind.
memory i will get back to when i’ve sorted the standard stuff out.
channels are not random its just a number set in a different class.

learning it fast as i can dude :)

  • You must to post comments
Showing 6 results
Your Answer

Please first to submit.