Fire sound play

For questions about using Classic.

Post » Thu Apr 12, 2012 5:07 pm

Hi all,

Actually I have a little problem with the audio channels, it's a very messy thing.

I want a sound to play when I left click, so I did that:

AT START OF LAYOUT:
XAudio: Load file "AppPath" & "pistolfire.ogg" to Channel 2 (Non Loop)

WHEN LEFT CLICK:
XAudio: Play Channel 2


--

So, the sound plays one time, when I left click, but when I click again, the sound is don't playing again.
As you can read, my prob is that the sound don't play again and again, I want the sound to play again and again when I click to the left button of my mouse.
What's the problem ? (Seriously, I don't like how actually Construct Classic works with audio files... I prefer the Construct 2 method, but I know... Technologies etc...)

Thanks guys TopsyKretts2012-04-12 17:10:43
B
4
Posts: 20
Reputation: 365

Post » Thu Apr 12, 2012 11:41 pm

The reason for this is that any sound file is only attached to a channel as long as it is playing.

Instead of loading the sound at start of layout just load it at mouseclick. Sound files are cached, so you will not have delays on subsequent loads. If you are afraid of a delayed play when it is loaded the first time, you can additionally cache the file manually.

+ Start of layout
-> Cache file (or cache directory, if you want to cache more than one file)

+ On mouse click
-> XAudio: Load file "AppPath" & "pistolfire.ogg" to Channel 2 (No Loop)
-> XAudio: Play Channel 2

Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Fri Apr 13, 2012 12:37 am

Ahh... now as you tell me this, I understand better what CC do with audio files...
Works fine, thanks ! :)
By the way, is there any tutorials to have good beggins in CC ?TopsyKretts2012-04-13 00:43:29
B
4
Posts: 20
Reputation: 365


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 6 guests