May 24, 2019, 11:17:58 PM

Author Topic: Channel volume won't decrease.  (Read 193 times)

Offline Yellownakji

  • Full Member
  • ***
  • Posts: 216
  • Whoop-de-doo-ba-dooo!
Channel volume won't decrease.
« on: April 30, 2019, 03:48:04 PM »
Hi.

I've tried:

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

No dice.

Offline Henri

  • Full Member
  • ***
  • Posts: 198
Re: Channel volume won't decrease.
« Reply #1 on: April 30, 2019, 06:44:45 PM »
Hi,

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

Code: BlitzMax
  1. Graphics 640, 480
  2.  
  3. Local channel:TChannel = AllocChannel ()
  4. Local sound:TSound = LoadSound ("shoot.wav")
  5.  
  6. Local pan:Float, vol:Float
  7.  
  8. Repeat
  9.         If MouseHit(1) Then PlaySound(sound, channel)
  10.        
  11.         pan = MouseX () / (GraphicsWidth () / 2.0) - 1
  12.         vol = 1 - MouseY () / 480.0
  13.         SetChannelPan(channel, pan)
  14.         SetChannelVolume(channel, vol*2)
  15.  
  16.         Cls
  17.         DrawText "Click to play...", 240, 200
  18.         DrawText "Pan   : " + pan, 240, 220
  19.         DrawText "Volume: " + vol, 240, 240
  20.  
  21.         Flip
  22. Until KeyHit (KEY_ESCAPE)
  23.  
  24. End

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

Offline Yellownakji

  • Full Member
  • ***
  • Posts: 216
  • Whoop-de-doo-ba-dooo!
Re: Channel volume won't decrease.
« Reply #2 on: May 01, 2019, 07:52:59 AM »
...

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..


Offline Derron

  • Hero Member
  • *****
  • Posts: 2087
Re: Channel volume won't decrease.
« Reply #3 on: May 01, 2019, 08:15:06 AM »
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

Offline Yellownakji

  • Full Member
  • ***
  • Posts: 216
  • Whoop-de-doo-ba-dooo!
Re: Channel volume won't decrease.
« Reply #4 on: May 01, 2019, 08:50:19 AM »
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.

Offline Derron

  • Hero Member
  • *****
  • Posts: 2087
Re: Channel volume won't decrease.
« Reply #5 on: May 01, 2019, 10:59:44 AM »
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

Offline Yellownakji

  • Full Member
  • ***
  • Posts: 216
  • Whoop-de-doo-ba-dooo!
Re: Channel volume won't decrease.
« Reply #6 on: May 01, 2019, 12:02:25 PM »
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.

Offline Derron

  • Hero Member
  • *****
  • Posts: 2087
Re: Channel volume won't decrease.
« Reply #7 on: May 01, 2019, 01:43:40 PM »
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

Offline Yellownakji

  • Full Member
  • ***
  • Posts: 216
  • Whoop-de-doo-ba-dooo!
Re: Channel volume won't decrease.
« Reply #8 on: May 02, 2019, 04:37:02 AM »
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.

Offline Derron

  • Hero Member
  • *****
  • Posts: 2087
Re: Channel volume won't decrease.
« Reply #9 on: May 02, 2019, 06:47:55 AM »
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

Offline Yellownakji

  • Full Member
  • ***
  • Posts: 216
  • Whoop-de-doo-ba-dooo!
Re: Channel volume won't decrease.
« Reply #10 on: May 03, 2019, 10:40:21 AM »
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.

Offline Derron

  • Hero Member
  • *****
  • Posts: 2087
Re: Channel volume won't decrease.
« Reply #11 on: May 03, 2019, 10:57:34 AM »
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