Audio - Control volume

Get help using Construct 2

Post » Tue Aug 07, 2012 10:10 pm

Hi!

I have a problem with the audio feature:



My problem here is that the sound seems to be played loudly for a frame and then the volume is reduced...

I'd like to set the sound volume BEFORE playing it for the first time, but I don't see how: is it possible?

The sound I want to set the volume is identifyable by its tag and this tag is defined when the sound is played... So I don't see any way to set the volume before the sound is played.

I could change the volume directly in the file the but still, I'd like to master these audio things in C2 (and it could make the process easier), that's why I ask this question.

Thanks in advance for your help :)

Rag'
B
17
S
4
G
4
Posts: 137
Reputation: 3,767

Post » Wed Aug 08, 2012 6:02 am

Just do

Every tick - set volume of "gun" to -10db

or what ever feels most comfortable to you
B
13
S
3
G
1
Posts: 44
Reputation: 1,152

Post » Wed Aug 08, 2012 6:20 am

That works, but I think it'd be a waste of processing power to keep on setting a sound file's volume to the same value on every tick.

How about..
Play the sound file
Set playback rate to 0
Set the volume
wait 0.1s
Set playback rate to 1
B
36
S
10
G
6
Posts: 948
Reputation: 11,101

Post » Wed Aug 08, 2012 7:10 am

The problem remains the same in these two cases: a very very short sound is played (probably for a frame) and THEN the volume is set lower.

As I said, you HAVE to play the sound to assign it a tag (even with "preload" you cannot do it), and use this tag in order to tweak the sound in question. So it seems normal that the sound is played normally for one frame before you can tweak it.

Is there nothing to tweak the sound parameters before it's played? If so, something's clearly missing in C2.

Did I miss something obvious?Ragtime2012-08-08 07:10:54
B
17
S
4
G
4
Posts: 137
Reputation: 3,767

Post » Wed Aug 08, 2012 7:16 am

That's not the case for me, all of my sounds are working just fine, thanks to every tick...
B
13
S
3
G
1
Posts: 44
Reputation: 1,152

Post » Wed Aug 08, 2012 6:58 pm

Have you actually tried changing the volume of the tag on the start of the layout, and it didn't work?
B
14
S
1
G
2
Posts: 85
Reputation: 2,810

Post » Thu Aug 09, 2012 7:41 am

It didn't work and it seems normal since on the start of the layout, the tag in question doesn't exist yet. It's defined at the very moment the sound is played for the first time.

Well, I've found a rough solution: make this sound volume lower in a sound editing software. It's a kind of defeat but something's clearly missing in C2... (the possibility to assign a tag without playing the sound)

Thanks for your answers, all of you!
B
17
S
4
G
4
Posts: 137
Reputation: 3,767


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 31 guests