Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 7 of 7
  1. #1
    Join Date
    Apr 2004
    Location
    Bavaria (Germany)
    Posts
    91

    Adding volumecontrol buttons for mpg-videos?

    Hello,

    in my project I added volume control buttons for mp3 sounds played over the background_channel, which work fine.

    Now I want to have the same control for the sound of mpeg-videos shown in the videoplayer. On which channel is the sound of the movies? Or is this not possible at all?

    Thank you!
    Schmidl

  2. #2
    Join Date
    Jun 2002
    Location
    Israel
    Posts
    1,843
    From the help file:


    Video.SetVolume (
    string ObjectName,

    number Volume )


    Description
    Sets the volume level of a video object.

    Parameters
    ObjectName
    (string) The name of the video object.

    Volume
    (number) The volume level represented by a number between 0 and 100. The value 0 is silent and 100 is the loudest.

    I think this is self-explanatory.

    Good Luck,
    Yossi

  3. #3
    Join Date
    Apr 2004
    Location
    Bavaria (Germany)
    Posts
    91
    Thank you for the hint,

    maybe I explained it wrong: I added buttons (+) and (-) for the volume control of mp3s. These mp3s run on the BACKGROUND_CHANNEL, so i.e the + button has on the action-tab:

    audio_channel = CHANNEL_BACKGROUND;
    Audio.SetVolume(audio_channel, Audio.GetVolume(audio_channel)+20);

    And I want exactly these two buttons for the volume control of a video played via a video object while it is running. But on which channel is the sound of a video to adapt the buttons? I know how to set the basic volume of a video, like you described, I want to change the volume while the video plays.

    Thanks again
    Schmidl

  4. #4
    Join Date
    Apr 2004
    Location
    Bavaria (Germany)
    Posts
    91
    Hi,

    is really nobody able to help me with that ?

    Schmidl

  5. #5
    Join Date
    May 2000
    Location
    Indigo Rose Software
    Posts
    2,150
    Schmidl,

    Please use this code assuming that you have a video on your page named "video 1":

    For the - button:
    -- get the current volume
    volume = Video.GetVolume("Video1");
    -- if volume is greater than 10
    if ((volume - 10) > 0) then
    -- set the volume down a notch
    Video.SetVolume("Video1", volume -10);
    end

    For the + button:
    -- get the current volume
    volume = Video.GetVolume("Video1");
    -- if volume is less than 100
    if ((volume + 10) < 100) then
    -- set the volume up a notch
    Video.SetVolume("Video1", volume +10);
    end

    I hope this helps.

    Adam Kapilik

  6. #6
    Join Date
    Apr 2004
    Location
    Bavaria (Germany)
    Posts
    91
    Hello Adam,

    thank you, it really helps ! I never came on that on my own .

    And, sorry, another thing: Is there a way to adapt the "Toggle.Play" function with the video sound as well? For normal audio I use "Audio.TogglePlay(CHANNEL_BACKGROUND);"

    Thank you again!
    Schmidl
    Last edited by Schmidl; 05-05-2004 at 09:01 AM.

  7. #7
    Join Date
    Jun 2004
    Posts
    1

    Toggle Video Music On/Off

    Hello, I recently found this post and it pointed me in the right direction as far as needing to toggle the music which is in a video file on and off - this thread talked about decreasing or increasingt he volume - by taking that concept I was able to "jimmy-rig" a toggle on/off for the audio. In my case I used the checkbox found in the special folder and applied the follow action:
    -- get the current volume
    volume = Video.GetVolume("VIDEO_NAME");
    -- if volume is greater than 10
    if ((volume - 10) > 0) then
    -- set the volume to 0
    Video.SetVolume("VIDEO_NAME", 0);
    else
    -- if volume is muted or O
    -- set the volume to 100
    Video.SetVolume("VIDEO_NAME", 100);
    end
    <<>>
    I am posting this here, though I know it is an old thread in hopes that it may be helpful to others looking to do what I did. Thank you for your help!

Posting Permissions

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