Announcement

Collapse
No announcement yet.

Sound with Scaleform and swf

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Sound with Scaleform and swf

    Hi, I'm trying to have sounds play in my swf file that serves as the main menu.
    I've tried linking sounds in the manner I do for .png files (triggering them with actionscript), and I've tried embedding sounds on the keyframes in the timeline. Both methods work fine playing the standalone .swf, but no sound plays in UDK editor or game. Scaleform website indicates embedded audio should be fine, and I can't find any details on the forums or udn. Any help appreciated!

    #2
    I believe the recommended path for sound in UDK is to use UDK sound themes and not sounds embedded in the Flash file.

    You would add something like this to the default properties section of your UI class file:

    SoundThemes(0)=(ThemeName=default,Theme=UISoundThe me'UDKFrontEnd.Sound.SoundTheme')

    Have a look at the Sound directory in the UDKFrontEnd package. Look at the properties for the SoundTheme asset you find there.

    FYI - to create a sound theme:

    * Open UnrealEd, and click on the Actor Classes browser (View -> Browsers -> Actor Classes)
    * Uncheck both the "Use 'Actor' As Parent" and "Placeable Classes Only" boxes
    * Locate UISoundTheme in the list, right-click, and select "Create Archetype..."
    * Select a location for your UISoundTheme to reside, and click OK in the dialog window that pops up

    Now that you have a new sound theme, you need to associate events with SoundCues to play. A full listing of the events that are fired off by CLIK widgets is available in the EventTypes.as ActionScript file, located at //UnrealEngine3/Development/Flash/CLIK/gfx/events/EventTypes.as . To associate an event with a SoundCue, simply add an entry to the Sound Event Bindings array (click the + icon), and type the event name in the Sound Event Name field, and the SoundCue that you would like to play in the Sound To Play field.

    Sound events are not only for CLIK widgets...sound events can be fired off arbitrarily from ActionScript using the following code:

    Code:
    if( _global.gfxProcessSound )
    {
         _global.gfxProcessSound(this, "SoundThemeName", "SoundEventName");
    }

    Comment


      #3
      Thanks, I'll try that. I have it working just by importing Sound Cues to my package, and using simple Sound objects in Kismet linked to fscommands from actionscript. That works well except I can't find a way to loop a particular sound, even though that option is selected in the Sound Cue's properties (right-click on icon in Content Browser).

      Comment


        #4
        Small hint for all copy and pasters. I don't think there is a spacebar in the middle of Theme...

        Comment


          #5
          Thanks Matt, you explained it beautifully, now I have working sound in my Main Menu

          Comment


            #6
            I've tried getting this to work with a flash movie but I can't.
            I've put in the default properties of my GFxMoviePlayer class:
            Code:
            SoundThemes(0)=(ThemeName=default,Theme=UISoundTheme'UDKFrontEnd.Sound.SoundTheme')
            And in my flash file I call one of these sounds:
            Code:
            if (_global.gfxProcessSound)
            {
            _global.gfxProcessSound(this, "SoundTheme", "change");
            }
            So I'm calling the already existent sound theme just to see if it works, which it however does not.
            Could anyone tell me what I'm doing wrong here, I'd greatly appreciate the help.

            Comment


              #7
              i use fscommand to play sound in kismet by interacting with the gfxmovie. Hope this helps u.

              Comment


                #8
                Originally posted by Matt Doyle View Post
                I believe the recommended path for sound in UDK is to use UDK sound themes and not sounds embedded in the Flash file.

                You would add something like this to the default properties section of your UI class file:

                SoundThemes(0)=(ThemeName=default,Theme=UISoundThe me'UDKFrontEnd.Sound.SoundTheme')

                Have a look at the Sound directory in the UDKFrontEnd package. Look at the properties for the SoundTheme asset you find there.

                FYI - to create a sound theme:

                * Open UnrealEd, and click on the Actor Classes browser (View -> Browsers -> Actor Classes)
                * Uncheck both the "Use 'Actor' As Parent" and "Placeable Classes Only" boxes
                * Locate UISoundTheme in the list, right-click, and select "Create Archetype..."
                * Select a location for your UISoundTheme to reside, and click OK in the dialog window that pops up

                Now that you have a new sound theme, you need to associate events with SoundCues to play. A full listing of the events that are fired off by CLIK widgets is available in the EventTypes.as ActionScript file, located at //UnrealEngine3/Development/Flash/CLIK/gfx/events/EventTypes.as . To associate an event with a SoundCue, simply add an entry to the Sound Event Bindings array (click the + icon), and type the event name in the Sound Event Name field, and the SoundCue that you would like to play in the Sound To Play field.

                Sound events are not only for CLIK widgets...sound events can be fired off arbitrarily from ActionScript using the following code:

                Code:
                if( _global.gfxProcessSound )
                {
                     _global.gfxProcessSound(this, "SoundThemeName", "SoundEventName");
                }
                I'm trying to fire off a sound playing without the use of clik-events.
                In my UISoundtheme i've added an event 'Typing' (i'm trying to fire off the event every time a cahracter gets added to a string, like an electronic typewriter:

                Code:
                if (_global.gfxProcessSound)
                		{
                			_global.gfxProcessSound(this, "LSSoundTheme", "Typing");
                		}
                the wrapping HUD class has this line defining the soundtheme:

                SoundThemes(0)=(ThemeName=default,Theme=UISoundThe me'LSSounds.LSSoundTheme')

                which works for Clik events. I've tried to change _global.gfxProcessSound(this, "LSSoundTheme", "Typing");
                to
                _global.gfxProcessSound(this, "LSSounds.LSSoundTheme", "Typing");

                but still no go. Any idea why it isn't working?
                i also have _global.gfxExtensions = true; in the top of the AS file

                Comment


                  #9
                  "Please contact Scaleform for audio and video integration support." Also in the scaleform launcher it says that audio and video are disabled so I do not believe you can use flash for your audio and will have to use something like fscommands instead.

                  Comment

                  Working...
                  X