Volume control problems (using XAudio2)

This forum is currently in read-only mode.
From the Asset Store
With this template you will learn how to use the GooglePlay Games native plugin
  • 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?

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

  • 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?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • [quote:2ki91xpq]But how do I know which channel my sound is playing on if I'm using the "autoplay sound" action?

    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.

    http://sourceforge.net/apps/mediawiki/construct/index.php?title=Main_Page

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

    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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)