Volume control problems (using XAudio2)

For questions about using Classic.

Post » Sat Oct 09, 2010 11:00 am

1. Are there any actions that can increase/decrease the current volume (of both sound and music)?
Currently, I see only "Set volume" for both, which requires you to set a specific number.

2. Apparently, the action "Set music volume" doesn't have any effect at all. The sound files (played using Play music) still plays at the same volume regardless of what I do. No such problem for Autoplay sound though. Is there something I'm doing wrongly?
B
5
S
1
G
3
Posts: 59
Reputation: 993

Post » Sat Oct 09, 2010 6:40 pm

Regarding your first question, most any action that lets you set a given property of an object has an expression counterpart that lets you read the current value. In this case, you can simply increment or decrement the current value by a given amount.

This would increase channel 1 volume and decrease the master volume:

+ On whatever triggers a volume change
-> XAudio2: Set channel 1 volume to XAudio2.Volume(1) + 1 dB
-> XAudio2: Set master volume to XAudio2.MasterVolume - 1

I don't know about the second question.
B
3
S
2
G
2
Posts: 187
Reputation: 1,449

Post » Sun Oct 10, 2010 2:37 pm

Ya, it would be great if I could set almost anything manually by using events/actions.

Is there a place where I can learn all the syntax for the various objects and stuff that can be used in Construct?

I assume XAudio2 is the default name of the XAudio2 object when you first add it in, which can be renamed.

But how do I know which channel my sound is playing on if I'm using the "autoplay sound" action?
B
5
S
1
G
3
Posts: 59
Reputation: 993

Post » Sun Oct 10, 2010 3:11 pm

[quote:2ki91xpq]But how do I know which channel my sound is playing on if I'm using the "autoplay sound" action?[/quote:2ki91xpq]
Autoplay uses the first available channel.

[quote:2ki91xpq]Is there a place where I can learn all the syntax for the various objects and stuff that can be used in Construct?

I assume XAudio2 is the default name of the XAudio2 object when you first add it in, which can be renamed. [/quote:2ki91xpq]
[url:2ki91xpq]http://sourceforge.net/apps/mediawiki/construct/index.php?title=Main_Page[/url:2ki91xpq]
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Sun Oct 10, 2010 3:23 pm

Some additional info:

[quote:28x1cczu]I assume XAudio2 is the default name of the XAudio2 object when you first add it in, which can be renamed. [/quote:28x1cczu]

This is true with any object in Construct. If you build expressions by point-and-click, the proper name will always be used, but you can also just type in expressions if you are familiar with the syntax, in which case you must type the proper name.

Also, one of the pages that I find most useful in the wiki is on the System Object:

http://sourceforge.net/apps/mediawiki/c ... tem_Object

It can provide some insight on what Construct considers conditions, actions, and expressions to be, and how to use the many general purpose ones provided by the System Object.

It should also be noted that you can access any condition, action, and expression through the mouse-driven interface, sometimes with minor editing of their arguments.
B
3
S
2
G
2
Posts: 187
Reputation: 1,449


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 6 guests