Stencyl 3.4.0 is now out. Get it now!

Channel for music

Unidx2

  • Posts: 13
Can anybody explain how to use the channel for music...I really don't understand

JeffreyDriver

  • Posts: 1311
You can choose from 32 channels (0-31) or you can just play the music and let Stencyl choose the channel automatically.

NickamonPoppytail

  • *
  • Posts: 483
These channels can be used for playing different sounds at the same time, e.g. You may play one sound on channel 0 and another on channel 1 at the same time.

Unidx2

  • Posts: 13
Why when I put the block "(Play)(Sound) on channel (1) the sound doesn't come out.

JeffreyDriver

  • Posts: 1311
Can you post your code.

Also, have you followed the instructions? E.g. removed meta data etc.

Unidx2

  • Posts: 13
Is this right??? what do you mean by instruction??
 

JeffreyDriver

  • Posts: 1311
When you create a sound you'll see a box on the bottom-right of the screen telling you details you need.

Also, your code isn't going to work properly as it's going to be performed multiple times per second when a button is down. You'd also need to stop the sound before triggering it again.

You'd be best approaching this with a custom event that triggers and stops the sound.

Another method that I've found works well for short looping sounds to have the sound loop continuously in the background, and just change the volume of it as needed.

Unidx2

  • Posts: 13
Can you show me the code...

decafpanda

  • *
  • Posts: 184
By look of this it seems like you want this sound to loop while this rocket is alive.  To simplify this sound code you could do

When created- loop 'rocket' on channel 1

When self is killed- stop sound on channel 1

This might work well unless you are doing something different with the sfx that I am not seeing. 

Unidx2

  • Posts: 13
what i'm doing is everytime this player moves, the sound will play

decafpanda

  • *
  • Posts: 184
Oh.  You could do

 "when (name of key)  is pressed" loop rocket sound on channel one

"When (name of key) is released" stop sound on channel one

These are input events.  Make sure you take the sound code off your always event.

Unidx2

  • Posts: 13
why is there no sound if i do the channel code

JeffreyDriver

  • Posts: 1311
Is there sound if you just use the 'loop sound' block?