Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2005
    Posts
    18

    Huh? on key toggle audio

    I have had no success doing what i thought should be an easy task. I simply want to use the spacebar to toggle audio on and off. I can get a button to work fine. However, I am having no success placing Audio.TogglePlay(CHANNEL_NARRATION); in an e-key in the on key event on the page. I can get the space bar to play or pause the audio, but not toggle. The audio starts playing when the page opens. I have a toggle button on the page that works fine.

    this is not working
    if e_Key == 32 then
    Audio.TogglePlay(CHANNEL_NARRATION);
    end

    But it does work if I switch to Audio.Play or Audio.Pause. i have even tried using a Page.clickobject directed at the toggle button on the page and that does not work.

    Final question i I am trying to use arrow keys for navigation as well. I get odd behavior when I use rt arrow( e_Key == 39). Rather than next page it appears to be issueing 2 next pages. this also happens if I use the click object command directed to the next button on the page. the next button on the page works fine. Any clues?

    Alan

  2. #2
    Join Date
    Dec 2003
    Posts
    891
    If you already have a toggle button on the page that works, then in the page on key event, try this

    --if the space key is pressed, click object search
    if e_Key == 32 then
    Page.ClickObject("Toggle_btn");
    end

    with the name of the toggle button in place of Toggle_btn.

  3. #3
    Join Date
    Jun 2005
    Posts
    18

    Did not work, curious indeed

    Quote Originally Posted by Roboblue
    If you already have a toggle button on the page that works, then in the page on key event, try this

    --if the space key is pressed, click object search
    if e_Key == 32 then
    Page.ClickObject("Toggle_btn");
    end

    with the name of the toggle button in place of Toggle_btn.
    Well I had tried this trick earlier with no success. I tried again just to make sure I was not using the wrong syntax. No go. I also tried using a alpha key to trigger the script. Nope still doesn't work. I can trigger other scripts no problem, including playing and pausing audio. But it will not toggle (the button on the page works fine). Any ideas?

    Alan

  4. #4
    Join Date
    Jun 2002
    Location
    Israel
    Posts
    1,843
    Alan,
    It works for me here.
    I am attaching a dummy project. check the Project Audio (as music is launched at startup and the onKey event.

    Yossi
    Attached Files

  5. #5
    Join Date
    Dec 2003
    Posts
    891
    works here too. With the audio in the project audio section.
    If you are playing a different background audio on each page, then you would load play in the page events.
    So, I tried loading the audio on page preload, then play on page show instead of in the project audio section. I even added a toggle button then using the Enter key clicking the toggle button. The space bar directly toggling the audio. It all works.
    Attached Files

  6. #6
    Join Date
    Jun 2005
    Posts
    18

    Thank you

    Quote Originally Posted by yosik
    Alan,
    It works for me here.
    I am attaching a dummy project. check the Project Audio (as music is launched at startup and the onKey event.

    Yossi
    Thanks for the help. I was using narration audio rather than background. I need to explore the diferrences. thanks again.

  7. #7
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    Hi, I might be wrong but I don't think there is any difference between the audio channels except the naming. So you can use whichever you like, you just have to make sure to reference it accordingly in any subsequent actions. I may be wrong about this, there may be a subtle difference with the background channel which I haven't noticed, so I stand to be corrected by the dev guys.

Similar Threads

  1. Playing Multiple Audio Files in Sequence
    By Desmond in forum AutoPlay Media Studio 5.0 Examples
    Replies: 6
    Last Post: 08-15-2005, 03:38 PM
  2. audio question
    By mike41 in forum AutoPlay Media Studio 5.0
    Replies: 0
    Last Post: 09-03-2004, 02:32 PM
  3. Example: Creating an on/off button to toggle background audio
    By Jonas DK in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 07-10-2004, 02:54 PM
  4. Responding to Key Presses
    By Desmond in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 09-26-2003, 09:49 AM

Posting Permissions

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