SetChannelPan
Monkey Forums/Monkey Programming/SetChannelPan
| ||
Hello! Does the command SetChannelPan work? I've downloaded the 83a version and I can't make it pan right or left, like BlitzMax. Does anyone know why? |
| ||
Which target platform? Which value do you use for left and right? |
| ||
So far for Desktop, the values are -1 and 1, acording to the documentation... |
| ||
On GLFW and HTML it works here like I would expect it. Running OSX 10.8.5. |
| ||
ok, I'm not using OSX. instead, I'm using Windows 7. on blitzmax it works fine.... |
| ||
Are you sure you are setting the channels correctly? |
| ||
Tested on Win7 too, it works. |
| ||
I think so... Here is it, it's just a test code, to learn the language. |
| ||
That's strange... How is your code? |
| ||
I just placed this in the autotest example after the SetUpdateRate(15) command:SetChannelPan(0,-1) SetChannelPan(1,0) SetChannelPan(2,1) And then I press 2 all the time so you hear the effect, |
| ||
Is the file you are playing stereo? Stereo files should play equally out of the left and right speakers no matter what you set the panning to. Only mono files would play correctly. If I remember OpenAL does not support the pan left/right as it is a 3D Sound API. As in real life a sound close to you on the left will be louder on the left than the right. You would still hear the sound through the right. If the sound was far away, then you would hear the sound equally through the left and right. Google Panning in OpenAL you will see there have been a number of questions asked. Use the code below and one of the compatible target shoot audio file formats from the examples. And then try your own audio file. |
| ||
Hello. I turn my audio into mono and it works perfectly. Thank you, dawlane. Thanks a lot, guys!! Best regards. |
| ||
Tips for audio: Music should be stereo for best results. If there is no difference between left and right channels, then consider using mono to save a bit of memory and disk space. Sound effects should be mono. Audio format support for web browsers depends on the browser, so expect to have to use the Dom module to try and work out which browser is being used so you can load the correct supported audio file. Also limit the number of sound channels being use to avoid sound issues. Search the forum in the HTML5 targets and in the BUGS section for more. The MP3 format is not seamless. I don't think looping audio was thought about when that format was drafted, so looping creates a gap. There are tools to remove or limit this gap in play back, but your mileage will vary. Not all audio formats are supported by the desktop targets. So don't expect to play an wma format on a Linux distribution. Two tools to check out if you are short on cash. LMMS is a free cross platform music creation application that is similar to FL Studio. Audacity is a free audio editing suite like SoundWave, etc. To export audio as MP3 you have to have LAME installed. |
| ||
Thanks, dawlane, for the tips. Regards |