A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: Changing Media Player volume?

  1. #1
    Junior Member
    Join Date
    Feb 2009
    Posts
    14

    Changing Media Player volume?

    Hi,

    I'm currently using the latest KM 7.x and using one of the "iPod" media player skins for our sample music clips.

    This works quite well, but one thing we have noticed is that the volume level of the playback is lower than what we would like. Not terrible but lower than we would like.

    The clips are recorded and post produced at levels that are just below clipping so increasing the levels in the mp3 files is not an option.

    There does not appear to be a volume/level control on the player skins that I've sampled.

    I was wondering if there is a way to change the volume level of the media player to bring it up closer to the levels that we see from other sites with Flash based media players?

    Thanks,
    Burt

  2. #2
    Super Moderator
    Join Date
    Jun 2000
    Posts
    3,512
    What player skins are you referring to?


    I'll let Wilbert handle this but I do see in the documentation for the mediaplayer class that the volume can be set

    -------------

    soundTransform property

    soundTransform:SoundTransform [read-write]

    A SoundTransform object can be assigned to the soundTransform property to set volume and balance.
    Implementation
    public function get soundTransform():SoundTransform
    public function set soundTransform(value:SoundTransform):void

  3. #3
    Senior Member
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    1,632
    There's a gui option for the media players named "Starting volume" that is set to 70 initially. Change it to 100 if you want the maximum volume.

  4. #4
    Junior Member
    Join Date
    Feb 2009
    Posts
    14
    Thanks,

    I totally missed the GUI initial volume setting for some reason.

    Burt

  5. #5
    Senior Member
    Join Date
    Dec 2010
    Posts
    111
    would like to know how I can use the
    set soundTransform(value:SoundTransform):void
    with a mediaplayer?

    I want to create controls for volume that are not part of mediaplayer skin

  6. #6
    Senior Member
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    1,632
    soundTransform is a mediaplayer property.
    If you want a volume of 60%, you can simply do it like this

    mediaplayer1.soundTransform = new SoundTransform(.6);

  7. #7
    Senior Member
    Join Date
    Dec 2010
    Posts
    111
    brilliant! thanks for that.

    My understanding of AS3 is limited to function calls, variables and cut and pasting code snippets. I do not understand the syntax for such as 'public properties', 'public methods', 'events' - so reading the koolmoves API I could see 'soundTransform' but had no idea how to implement it.

    I also noticed there is lower case 's' for the first term ('soundTransform') then upper case 'S' for the second..

    soundTransform = new SoundTransform

    ANYWAY....wondering one other thing....

    how can I assign an event listener to a Koolmoves GUI slider to become a volume slider? (for mediaplayer also)


    much appreciated

  8. #8
    Senior Member
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    1,632
    SoundTransform with the upper case 'S' is the class.
    With the 'new' keyword you create a new instance of the class that is assigned to the soundTransform property of the mediaplayer component.

    The easiest way to use the GUI slider is like this

    slider1.onScroll = function(){
    mediaplayer1.soundTransform = new SoundTransform(this.scrollPosition / 100);
    }

  9. #9
    Senior Member
    Join Date
    Dec 2010
    Posts
    111
    thanks Will,

    I didn't specify, global volume also?


    cheers

  10. #10
    Senior Member
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    1,632
    Try assigning to
    SoundMixer.soundTransform

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center