How do I add an audio to an object

Get help using Construct 2

Post » Tue Mar 11, 2014 2:14 pm

Firstly, I want to add a fire burning sound at the Fire object, which I wanted that when the Fire is far away, the sound gets softer and when the Fire is near, the sound gets louder.
However, I tried using
"On start layout" then I select "Play at object", i choose the fire burning sound and select Fire as the object.
And the problem is, the fire burning sound does not get softer nor louder even the distance has changed. Any idea?
B
5
Posts: 35
Reputation: 331

Post » Tue Mar 11, 2014 2:25 pm

I haven't played with this kind of thing yet, but I have looked into the Audio a decent amount. Have you considered tying the playing of the sound to the distance Object B is from Fire? So as Object B gets closer to Fire, Fire's Audio event kicks in at a certain volume level; as Object B gets further away, Fire's Audio event kicks in at a lower volume level.

Would that help?
B
7
S
1
G
1
Posts: 56
Reputation: 732

Post » Tue Mar 11, 2014 4:21 pm

You need to configure your Audio object correctly, as seen in this example.

positionalAudio.capx
You do not have the required permissions to view the files attached to this post.
B
57
S
15
G
11
Posts: 912
Reputation: 12,606

Post » Wed Mar 12, 2014 2:46 am

@GeometriX Now I know what's the problem I have, I didn't put the audio action as "Set listener object", thanks a lot!
B
5
Posts: 35
Reputation: 331

Post » Thu Mar 13, 2014 2:17 pm

I need help again, the audio loudness affected by distance works ok when I tested in computer(I used chrome browser), but when I test my game on my phone, the audio loudness does not change even the Player is near or far from the Fire object. Anyone can help me, thanks.
B
5
Posts: 35
Reputation: 331

Post » Thu Mar 13, 2014 3:22 pm

From manual:

"Advanced audio
The Audio object supports some advanced features, such as positioned sounds and convolution effects. However these depend on the Web Audio API which is not supported in all browsers. You can detect if these features are available using the Advanced audio supported condition. If it is not supported, the advanced audio features will not change the sound in any way.

Positioned sounds are an advanced audio feature that allow you to play a sound at a position, or on an object, in the layout. Using a 3D audio engine, the pan and volume are adjusted according to their relative position to the listener. This is an easy way to enhance realism and further immerse the player in the game."

Probably the phone doesn't support advanced audio.
Please tag me with @caiorosisca if your post is refering to me :). I don't always follow the topics I answer.
B
11
S
4
G
1
Posts: 272
Reputation: 1,643

Post » Fri Mar 14, 2014 2:07 am

so is there anyway that I can use alternative way to make the same feature(advanced audio position), maybe in construct 2 i put the event in another specific way?
B
5
Posts: 35
Reputation: 331

Post » Fri Mar 14, 2014 11:57 am

You can try comparing the player distance to the fire and choose how close they have to be to start hearing the fire. Then adjust it depending on the closeness.
B
23
S
4
G
2
Posts: 364
Reputation: 2,392

Post » Sat Mar 15, 2014 2:40 am

@phoenixNightly ya I also thought of that, but I'm a beginner and I not sure how to do it.
B
5
Posts: 35
Reputation: 331

Post » Sat Mar 15, 2014 12:44 pm

@Serge Low

Once I finish some school reports I have to write up I will help you out.
B
23
S
4
G
2
Posts: 364
Reputation: 2,392

Next

Return to How do I....?

Who is online

Users browsing this forum: mikehive and 12 guests