PC-Logix / OpenFM

Streaming radio mod for Minecraft, with OpenComputers control support
MIT License
25 stars 17 forks source link

[1.7.10] Mono is played in a single speaker #68

Open xunto opened 6 years ago

xunto commented 6 years ago

It looks like this mod (at least 1.7.10) is not mantained anymore but maybe somebody can help me with this problem.

I found out that mono sounds are played in single speaker.

In the code it's hardcoded not to use amount of channels defined by given file but always assume there is 2 channels. Here: https://github.com/PC-Logix/OpenFM/blob/f3e6c4cae7225ab5931fb2277ea7dd9c3131ce81/src/main/java/pcl/OpenFM/player/AudioPlayer.java#L64-L68

That's obviously the reason. That's why (format.getChannels() > 1) ? AL10.AL_FORMAT_STEREO16 : AL10.AL_FORMAT_MONO16 will always return AL10.AL_FORMAT_STEREO16 https://github.com/PC-Logix/OpenFM/blob/f3e6c4cae7225ab5931fb2277ea7dd9c3131ce81/src/main/java/pcl/OpenFM/player/AudioPlayer.java#L132

But I also found out that with AL10.AL_FORMAT_MONO16 sound doesn't appear at all. I'm not really good in OpenAL can sombody help me to fx this?

I used these files while testing: mono: http://music.konungstvo.ru/fall_of_the_magister.mp3 stereo: http://music.konungstvo.ru/fall_of_the_magister_stereo.mp3