Channel volume won't decrease.

Started by Yellownakji, April 30, 2019, 15:48:04

Previous topic - Next topic

Yellownakji

Hi.

I've tried:


[var]:tchannel.setvolume(0.2)
setchannelvolume(channel,0.2)


No dice.

Henri

Hi,

this works for me (shoot.wav is in bmax folder):

Code (blitzmax) Select

Graphics 640, 480

Local channel:TChannel = AllocChannel ()
Local sound:TSound = LoadSound ("shoot.wav")

Local pan:Float, vol:Float

Repeat
If MouseHit(1) Then PlaySound(sound, channel)

pan = MouseX () / (GraphicsWidth () / 2.0) - 1
vol = 1 - MouseY () / 480.0
SetChannelPan(channel, pan)
SetChannelVolume(channel, vol*2)

Cls
DrawText "Click to play...", 240, 200
DrawText "Pan   : " + pan, 240, 220
DrawText "Volume: " + vol, 240, 240

Flip
Until KeyHit (KEY_ESCAPE)

End


-Henri
- Got 01100011 problems, but the bit ain't 00000001

Yellownakji

#2
Quote from: Henri on April 30, 2019, 18:44:45
...

This example does not work for me.  Exception access violation, even with the wavloader module.  Yes, i did (filetype) and the file exists in root.

However, if i change the file to an OGG file, it runs fine.  volume works too.

I figured out that you must change the volume AFTER you play the sound.  Thanks..


Derron

You must change the volume after you created the channel.

If you used wavloader...was the TSound valid or null?
With that many issues you experience with NG on your OS I somehow think it is your setup/hardware creating issues. Else I assume others would report similar issues too.

Bye
Ron

Yellownakji

Quote from: Derron on May 01, 2019, 08:15:06
You must change the volume after you created the channel.

If you used wavloader...was the TSound valid or null?
With that many issues you experience with NG on your OS I somehow think it is your setup/hardware creating issues. Else I assume others would report similar issues too.

Bye
Ron



Initially in my initialize source, i created the channel and then directly underneath i set the volume.  No dice.
However, setting it after i call playsound() works.

The TSOUND wav was returned null, after loadsound, but it WAV did exist.  I verified.  -- I have the same sound, as an OGG, and it loaded just fine with OGGLOADER mod.

Derron

Can you setup a VM with a popular linux distribution (linux mint or ubuntu) install NG in there .. and try out some of your sample codes there?

This creates a reproduceable environment (except for broken hardware in your computer).

Bye
Ron

Yellownakji

Quote from: Derron on May 01, 2019, 10:59:44
Can you setup a VM with a popular linux distribution (linux mint or ubuntu) install NG in there .. and try out some of your sample codes there?

This creates a reproduceable environment (except for broken hardware in your computer).

Bye
Ron

I compile for Linux and OSX in a VM.  any issues i'm having with my main windows binary is also in those nightly builds.   When i changed the volume after calling playsound(), it also changed the volume on linux and OSX.

Derron

So what Linux do you have in a VM.
Do you have the other issues there too (paths with slashes etc).

Maybe I can setup the very same linux here and then we just need to ensure to have the same NG data (maybe zip up your NG installation dir of the linux box and make it available for me/others to check).


bye
Ron

Yellownakji

Quote from: Derron on May 01, 2019, 13:43:40
So what Linux do you have in a VM.
Do you have the other issues there too (paths with slashes etc).

Maybe I can setup the very same linux here and then we just need to ensure to have the same NG data (maybe zip up your NG installation dir of the linux box and make it available for me/others to check).


bye
Ron

I run Linux Mint 19.1; I have the bog standard NG 0.99 with the required libs + bah.mod and it's dependency hell list of libs.    For OS X, i use ElCapitan and both are under VMWare Player 15.

I did manage to switch HDDs in my MacMini, so i have a REAL modern Mac now.  however, Apple are a bunch of scheming [*************] and won't let me get XCode, so i'm currently pirating Xcode 8.2.1 and i'm not even ashamed to acknowledge it.

I'll get around to bundling up the linux distro;  Yes, like OS X, it has slash issues that i fixed by using a variable modified by conditions.

Derron

#9
Also zip up an example of the slash/sound sources you use...just to ensure we get the same file encoding.

Will setup a 19.1 VM meanwhile. Oh ehm... Which flavor? Xfce ?
Downloaded iso in 2 minutes.

Set up a new VM ... booted iso and got graphical corruption
"host + F1" (right ctrl + F1 here) to go into the first terminal/shell
login: mint
password: empty
sudo apt-get install virtualbox-guest-dkms virtualbox-guest-dkms
systemctl restart lightdm
... got a display.

installing now.
For now I've choosen German localization - but we might have to use your exact localization you use there).

Bye
Ron

Yellownakji

Quote from: Derron on May 02, 2019, 06:47:55
Also zip up an example of the slash/sound sources you use...just to ensure we get the same file encoding.

Will setup a 19.1 VM meanwhile. Oh ehm... Which flavor? Xfce ?
Downloaded iso in 2 minutes.

Set up a new VM ... booted iso and got graphical corruption
"host + F1" (right ctrl + F1 here) to go into the first terminal/shell
login: mint
password: empty
sudo apt-get install virtualbox-guest-dkms virtualbox-guest-dkms
systemctl restart lightdm
... got a display.

installing now.
For now I've choosen German localization - but we might have to use your exact localization you use there).

Bye
Ron

I will be zipping my BMX install and an example.   I'm on ENGLISH_US and Cinnamon flavor.

Derron

OK so once you uploaded it I will install it here too - just to checkout stuff. Maybe we can squish out this little nasty bug.


bye
Ron