- Joined
- Jul 3, 2017
- Messages
- 261
I don't think this is a bug from Monkey-x / Cerberus X. But hear me out:
I'm trying to make a game for blind people. On desktop I calculate the distance the enemy is from the camera (using MiniB3D!) and from there I take if the enemy is to the left / right / in front of the player.
This is basically what I do:
It works really well on desktop. But on Android, it sounds completely wrong!
Enemys right in front of you plays very, very low volume. If I move to any side, the volume practically doubles.
So I tried fixing values. SetChannelPan(channel, 1) < plays both channels, normal volume
So I tried fixing values. SetChannelPan(channel, -1) < plays both channels, normal volume
So I tried fixing values. SetChannelPan(channel, 0) < plays both channels, very low volume
I look at mojo.android.java, and as far as I can tell, setPan looks normal.
I'm lost. I've tried this on 2 different devices, same results. Even using an external headphone (same one I use on desktop for testing) and nothing changes.
Have anyone faced this before? Any clues?
I'm trying to make a game for blind people. On desktop I calculate the distance the enemy is from the camera (using MiniB3D!) and from there I take if the enemy is to the left / right / in front of the player.
This is basically what I do:
Cerberus:
Local dx:Float = (EntityX(cam) - pos.x) / 10.0
if dx>1 then dx=1
if dx<-1 then dx=-1
SetChannelPan(channel, -dx)
It works really well on desktop. But on Android, it sounds completely wrong!
Enemys right in front of you plays very, very low volume. If I move to any side, the volume practically doubles.
So I tried fixing values. SetChannelPan(channel, 1) < plays both channels, normal volume
So I tried fixing values. SetChannelPan(channel, -1) < plays both channels, normal volume
So I tried fixing values. SetChannelPan(channel, 0) < plays both channels, very low volume
I look at mojo.android.java, and as far as I can tell, setPan looks normal.
Cerberus:
int SetPan( int channel,float pan ){
gxtkChannel chan=channels[channel];
chan.pan=pan;
if( chan.stream!=0 ){
float rv=(chan.pan * .5f + .5f) * chan.volume;
float lv=chan.volume-rv;
pool.setVolume( chan.stream,lv,rv );
}
return 0;
}
I'm lost. I've tried this on 2 different devices, same results. Even using an external headphone (same one I use on desktop for testing) and nothing changes.
Have anyone faced this before? Any clues?