Product Chat / Global Sound Volume not working properly

Author
Message
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 4th May 2020 16:26 Edited at: 4th May 2020 16:31
Hi all. I've been having some issues with global sound volume. I set the volume to 0, but still hear it faintly in the background.


Not tested the above code, just typed a quick example in based on my script. You will need to add your own sound and directory. Anyone else still hear the audio?
I could stop the sound of course, but that does not work with what I want to do. This definitely seems like a bug? Which should be easy to fix I would think.
SPECS: Ryzen 1700 CPU. Nvidia 970GTX. 16 Gig Memory. Win 10.
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 4th May 2020 18:48
You have to play the sound first then set the volume.
Been there, done that, got all the T-Shirts!
PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 4th May 2020 19:44
@ DVader
Most likely you will end up with a LoopSound(), with that code.
I means, when your sound end up, then GetGlobalSoundPlaying(5) will turn to be equal to zero, and most likely the sound will play again and again.
Anyway I have not tested your script yet, I'm having bad feelings right now (thinking about format c: command), making buckups.
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 5th May 2020 03:30 Edited at: 5th May 2020 03:36
@AmenMoses Doesn't seem to make any difference where I place the volume command before or after both work; I've even tried before and after
@3com That's what I am after, a loop I've also tried using the loop command. Both have the same issue.

It works fine if I just play each effect, but that makes them start over each time and is not very radio like. I can alter the volume fine and the radio works perfectly, apart from the low mad babble that's emanating from it because zero is not zero

It could be a weird code issue still, but am struggling to see anything obvious.
SPECS: Ryzen 1700 CPU. Nvidia 970GTX. 16 Gig Memory. Win 10.
PCS
8
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 5th May 2020 06:46 Edited at: 5th May 2020 06:48
you can always tel the script that when volume = 0 to stop playing the sound
i had the problem when i walk away from a sound zone , that the sound also keep on playing even if the volume is 0, then i also had to stop sound playing.
Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 5th May 2020 11:10
Try setting the volume to 1 instead of 0, for me anything less than 60 is pretty much silent anyhow (I think the value might be Db!).
Been there, done that, got all the T-Shirts!
PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 5th May 2020 12:31

@ Dvader
Not sure if I've got your point, anyway thid might help since it is distande-based.



Related thread

Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 5th May 2020 19:54
@PCS. Stopping the sound makes it non persistent which is what I am after, radios don't start over when you switch channel or turn them off and on.
@AmenMoses. Unfortunately setting to 1 just makes it a tiny bit louder.
@3com. I'm changing the volume fine really, just that 0 volume is still audible.
A video may show it better.
SPECS: Ryzen 1700 CPU. Nvidia 970GTX. 16 Gig Memory. Win 10.
Bored of the Rings
GameGuru Master
19
Years of Service
User Offline
Joined: 25th Feb 2005
Location: Middle Earth
Posted: 5th May 2020 20:02
Try minus 1
Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++ VS2019, SQL, PL-SQL, JavaScript, HTML, Three.js, others
Hardware: ULTRA FAST Quad Core Gaming PC Tower WIFI & 8GB 1TB HDD & Win 10 + 2GB GT710
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 5th May 2020 20:06
@Bored of the Rings. When I tried that is just crashed GG. I can give it another try though.
SPECS: Ryzen 1700 CPU. Nvidia 970GTX. 16 Gig Memory. Win 10.
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 5th May 2020 20:21
yep, still playing at a very low volume at 0
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 5th May 2020 20:33
@ DVader
Love how you are getting these radio.
Unfortunatelly you are right about volumen, it just behaves as zero sound with distance based script.
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 5th May 2020 20:34 Edited at: 5th May 2020 20:53
@smallg. Thanks for the confirmation! It's been driving me potty!

I've also found if you play or loop a sound on first loading the volume seems to jump back up to full regardless until GG is fully loaded in.
If I put this little bit of code in the sound stays at 0 (still audible of course :/ )

If I try to just run it once or anywhere towards 40, the sound blares at top volume.
At the minute there is still a minor audio blip when it starts up, which is also annoying but not as bad as the incessant whispering lol. I would have thought setting the volume should be a one off thing not a constant update as it seems to need at the beginning. Something seems to override the volume settings until things have settled :/ Weird.

Edit- A small alteration to the above code so it waits then runs once, gets rid of the blip, definitely caused buy playing a sound too quickly after loading; but not the low sound issue. That for certain seems like a bug.

@3com. Thanks! Until I noticed the low sound problem, I was thinking it was pretty neat myself it's not quite the GTA radio, but it has several hours of stuff in which isn't too bad for GG.
SPECS: Ryzen 1700 CPU. Nvidia 970GTX. 16 Gig Memory. Win 10.
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 5th May 2020 21:30
If this isn't listed on github as an issue, it should be. I think it is the same with all sound commands, not just the global ones. Admittedly I haven't tested rawsound ones. But setting the normal volume seems to have no effect either.
SPECS: Ryzen 1700 CPU. Nvidia 970GTX. 16 Gig Memory. Win 10.
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 5th May 2020 21:49
How weird, is this recent or has it always done that?
Been there, done that, got all the T-Shirts!
PM
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 5th May 2020 21:58 Edited at: 5th May 2020 21:59
I couldn't say, as I haven't messed with sound stuff in ages. Normally this would be a bit of polish at the end of a game, but never generally get there As is this is just part of an experiment at the moment, spent more time than normal with it. Perhaps it's done for loading speed and is fully enabled only when things are fully loaded.

Definitely works making sure you pause for a few seconds before playing any sounds if you don't want any weird loud glitches. I can live with it now I know, but would certainly like to see the sound level issue resolved.
SPECS: Ryzen 1700 CPU. Nvidia 970GTX. 16 Gig Memory. Win 10.
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 6th May 2020 03:34
While they are working on this, perhaps also useful would
be a SetSoundStart(e,t,v) time-- for those special moments...

https://answers.unity.com/questions/993241/how-to-play-specific-part-of-the-audio.html

PM
Tarkus1971
Audio Media Maker
9
Years of Service
User Offline
Joined: 24th Feb 2015
Location: England, UK
Posted: 6th May 2020 08:38
I think it's always done this, if I have a lot of distance based sounds they all play at full volume for a split second until the level has started proper and then the volume drops to what it should be. But only with MONO 44.1k WAV files for me, it might occur with stereo files but I am not sure.
Aftershock Quad Core AMD FM2+ 3.5 GHz 8GB Motherboard and Processor, A7700k apu, Asus GT970 STRIX 4gb Nvidia gfx card.
King Korg Synth, Alesis SR18 Drum Machine, Akai MPX8 sample player, Roland Fantom XA Synth, Axus Digital AXK2 Digital Drum Kit, Novation Ultranova Synth, Waldorf Blofeld Synth, Roland D05 Synth Module, Bluedio Victory V Headphones, AKG K141 Studio Headphones, Lenovo Ideapad, with Windows 10 64bit, 8Gb Ram and AMD A10 7th Gen Graphics. Acer Swift i3 Laptop with Intel Optane memory, Intel 620UHD GPU, Windows 10 64bit.
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 6th May 2020 08:59
Can't remember if GG can run MONO 44.1k 16bit or it has to be 8bits.
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 6th May 2020 10:04
WAV - 16 Bit signed PCM is what I usually use for sound effects.
Been there, done that, got all the T-Shirts!
PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 6th May 2020 13:40
Thanks AM
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 6th May 2020 15:14
I would hope GG supports a variety of frequencies and bit-rates really. We don't always need CD quality sound.
A way to play a sound from where you want would be useful, but doesn't exist at the moment. The volume of course does exist and so should work
SPECS: Ryzen 1700 CPU. Nvidia 970GTX. 16 Gig Memory. Win 10.
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 6th May 2020 16:51
If you mean playing a sound from a specific 3D position then simply attach the sound to a small invisible entity and move the entity to the position then play the sound, as long as it is a mono WAV file of course.
Been there, done that, got all the T-Shirts!
PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 6th May 2020 21:04
Or just attach the sound to the Preben's sun rotation, and then you will end up with music shadowed around the world.
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 7th May 2020 15:41
No. I meant playing the sound from any point in the sample. Nothing to do with position and 3d sound effects
SPECS: Ryzen 1700 CPU. Nvidia 970GTX. 16 Gig Memory. Win 10.
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 7th May 2020 16:36

You're right Dvader. Along with the starting call we would need
a call for stopping that sound, so adding a number assignment
to any starting sound would be handy... like naming the sound.
The e is the entity num, but that doesn't make the assigned name.
something like this...
SetSoundStart(e,#,t,v) = e, sound #, sound file time pointer, volume
also-
SetSoundStop(e,#).

The Timer() function would be the legs of this technique.
PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 7th May 2020 17:00
@ DVader
Just joking mate.
Anyway there is not any GG LUA command than get the audio file duration, knowing that value would be a good starting point to achieve it.
IE: the first 44bits in a wav file are the header and contain all this info.
Meantime the only solution comes with split the sound into the parts you want, and plays them whenever you want to.
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 7th May 2020 17:05
This sort of thing is possible with memblocks in DB and other languages. It's even possible to directly read data in from code to make sound effects also Did a lot of work on media free demo's years back, even made a space invaders clone with sound effects without any sound samples at all All from code. I do miss that sort of flexibility in GG.
SPECS: Ryzen 1700 CPU. Nvidia 970GTX. 16 Gig Memory. Win 10.
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 7th May 2020 17:25
Quote: " I do miss that sort of flexibility in GG."

Me too.
I get that info via VS, not idea about DB, I've arrived here too late.
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 8th May 2020 00:27
sound... "All from code"
I'm sure C++ has a feature for this type of sound generation- to link
Lua with. QBasic did so in Windows 95!
It's a handy source for basic sounds, just not music and speech!
Someone once ridiculed the idea... but for what reason?

What was also fun was the draw commands. Box, circle, line, etc.
Also you could detect the color of any pixel on screen, a similar function
would really be a handy feature to use for menus, status bars and much
more. So my main hobby in that was cheesy screen savers.

https://stackoverflow.com/questions/5469030/c-play-back-a-tone-generated-from-a-sinusoidal-wave


PM
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 8th May 2020 14:42
Quote: "It's a handy source for basic sounds, just not music and speech!"

I don't know I once got a tune from the Matrix playing with just code I converted it to code first of course But it was fine, just a lot of data I had a youtube vid of it, but the music was removed.
I also used pixel colour detection for pixel perfect collision in DB Pro which was super fast and super accurate Faster than automatic collision anyway Had level 1 of R-Type running perfectly with it.
SPECS: Ryzen 1700 CPU. Nvidia 970GTX. 16 Gig Memory. Win 10.
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 15th May 2020 20:14
I just want to verify, if I could please, what are the .wav requirements
for GlobalSounds? I guess all sounds, but ambient (Music primarily)
16 bit--- can't do 32? Stereo is okay? Bit-rate is important?
What would cause a .wav file not to play (cause Error?)

Thanks, looking about the threads, and this foundational
subject seems to be alluding me.
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 15th May 2020 20:40
The only restriction I know of is for 3D sounds which have to be mono WAV.

I tend to stick with 16 bit mono wav files for sound effects and ogg files for music or background atmospherics.
Been there, done that, got all the T-Shirts!
PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 15th May 2020 21:31 Edited at: 15th May 2020 21:59
Okay, yeah. Well, I used some stock music already in my folders that worked--
looked them over in Audacity, and seen that they where 32 bit 44100 stereo
.wav
the one that errored was 22050 rate .wav So I switched it over to the higher
rate, thinking I was good to go. Anyhow it seems like .ogg and wav both work
at 44100 stereo, 32 bit. Not a bad sound.
PM
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 16th May 2020 08:39
You should be able to use any bit rate you want and can live with. If you want 3d sound to work use wavs as Amen suggests. If that is not an issue ogg files are more compact for final standalone size Load faster as well, which is for certain, an area in GG standalones that can always be improved.
SPECS: Ryzen 1700 CPU. Nvidia 970GTX. 16 Gig Memory. Win 10.

Login to post a reply

Server time is: 2024-11-23 17:38:17
Your offset time is: 2024-11-23 17:38:17