How do you fade a Sound ogg file in or out?

JCFordJCFord Member Posts: 785
I know you can fade background MUSIC file IN and OUT using the Interpolate Attribute

i.e.
RULE
Actor event Touch is pressed
INTERPOLATE
game.Audio.Volume to 0
Duration 1
Function Linear

But I want to be able to fade some of my Sound files (ogg) with a similar method, but cannot see a way of doing this as the built in game.Audio.Volume attribute only seems to effect MUSIC not Sound files?

Thanks
JCFord

Comments

  • VmlwebVmlweb Member Posts: 427
    What you can do is create a attribute called Volume and then in the sound behaviour you put the volume as the attribute.
    You can now control the volume using the attribute and use interpolate to fade it in or out
  • JCFordJCFord Member Posts: 785
    Of course - Thanks VMlweb I was having a blonde moment!

    Worked a treat,
    Thanks
    JCFord
  • dmaredmare Member Posts: 7
    I'm still having trouble with this actually.

    I want to make a sound fade in when you touch a button and fade out when you let go. (I still wanted it playing when the button isn't touched, but with the volume at zero)

    here are some screenshots.
    http://goo.gl/Y7Lw (this works, but doesn't fade out, it just cuts off.)

    and these two don't work, but they should.
    http://goo.gl/c7Fq
    http://goo.gl/kloI

    I've made a new integer attribute set to 0 called 1btnvolume, but any method I try to fade it out it doesn't work. (it just keeps playing at full volume).

    I'm at my wits end. Anyone know how to make it work?
  • AfterBurnettAfterBurnett Member Posts: 3,474
    I didn't even know you could fade music! Lol! Thanks, guys!
  • dmaredmare Member Posts: 7
    never mind... interpolate works!

    although is there anyway to fade our 'music' files and not 'sound' files?

    ... I ask b/c it automatically converts 'sounds' to .ogg and low quality mono... and I want to keep the sounds in stereo.

    'Music' sounds files play in .mp4a stereo, (exactly what I want) but don't know how to get them to fade...

    any ideas?
Sign In or Register to comment.