showController for audio question???

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

showController for audio question???

Ban Nguyen
Hello,

I use this code for video and it works perfect
set the showController of the templatePlayer to true
play videoclip "My Clip"

I use the similar code for audio and it does not work.  It plays the
song but does not show the controller

set the showController of the templatePlayer to true
play audioclip "My Clip"

-------------------------
My problem is:  I have a list of 9 songs and I want to show them in a
list and let user click on one song at a time and play it

I use the scrolling list field to display those songs.  Here is the code
of the scrolling list field:

on mouseup
    global gClickVar
    select the clickLine
    put word 2 of the clickLine into gClickVar
   
   -- get the song name    
   put line gClickVar of field "audioList" into gClickVar    
   play audioClip gClickVar looping
   
end mouseup

----------------------
I create a play button.  Here is the code for the play button (it works
fine):

on mouseUp
  global gClickVar
     play audioClip gClickVar looping
end mouseUp

-------------------------
I also create the stop, prev and next button.  They works fine

-----------------------
My problem is I don't know how to create the volume slider to control
the volume

-----------------------
I use this code for the pause button:
on mouseUp
    global gClickVar
    play pause audioClip gClickVar
end mouseUp

It stops the song and plays the beginning of the song when I release the
mouse.  I want to pause it and click again to continue play (not
beginning)

---------------------
so that why I am trying to use this code so I don't have to worry about
volume and stuff...:

set the showController of the templatePlayer to true
play audioclip "My Clip"

but it does not work


---------
Does the player object play the imported song (import as a control) or
only play songs on the hard drive that you insert in the source
(C:\audio\songs....)


Please help me.  Anyone has any idea?  Thank you








_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: showController for audio question???

Klaus major-k
Hi Ban,

> Hello,
>
> I use this code for video and it works perfect
> set the showController of the templatePlayer to true
> play videoclip "My Clip"
>
> I use the similar code for audio and it does not work.  It plays the
> song but does not show the controller
>
> set the showController of the templatePlayer to true
> play audioclip "My Clip"

since i was EXTREMELY surprised that this:

> set the showController of the templatePlayer to true
> play videoclip "My Clip"

really did work, i cannot answer the audio player question.
I am afraid that this is simply not supported with sounds.

> ...
> -----------------------
> My problem is I don't know how to create the volume slider to control
> the volume

well, i actually showed you how in one of my mails yesterday...

To help your memory a bit, here is what i wrote:

>> I want to have a volume control to control the sound

I want to have real tables ;-)

> Simply use a "slider", vertical or horizontal!
>
> Set the startvalue to 0
> The endvalue to 100
>
> And put this into the script of the slider:
>
> on scrollbardrag t_value
>    set the playloudness of player "your audio playername here" to  
> t_value
> end scrollbardrag
>
> Done :-)
>
> The message "scrollbardrag" is being sent to Revolution continuously
> while the user drags the slider. The message can have 1 parameter,
> the current value of the slider, so this script will work in realtime.
>
> Hope this helps.

Since you do not work with player objects you should change the line to:

on scrollbardrag t_value
    set the playloudness to t_value
end scrollbardrag

> ---------------------
> so that why I am trying to use this code so I don't have to worry  
> about
> volume and stuff...:
>
> set the showController of the templatePlayer to true
> play audioclip "My Clip"
>
> but it does not work

See above, be prepared that it won't work at all :-/

> ---------
> Does the player object play the imported song (import as a control) or
> only play songs on the hard drive that you insert in the source
> (C:\audio\songs....)

The latter on, only referenced files, but that is no problem,  
actually :-)

With the "play" command you can only play a very small "subset" of
all possible sound files: Uncompressed AIF files and AU files.
WAV files are reported to make some problems.

AND you can only play one sound at a time!

> Please help me.  Anyone has any idea?  Thank you

I help. Yes, i do. You're welcome.

:-)


Regards

Klaus Major
[hidden email]
http://www.major-k.de

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: showController for audio question???

Eric Chatonet
In reply to this post by Ban Nguyen
Hi Ban,

Be patient.
Your requests gave me the idea to write a tutorial about managing  
sounds and players.
May be it will be my 20th tutorial (see my web-site).
In the meantime, please, check the docs :-)
For instance: playLoudness...

Le 13 juil. 05 à 21:06, Ban Nguyen a écrit :

> Hello,
>
> I use this code for video and it works perfect
> set the showController of the templatePlayer to true
> play videoclip "My Clip"
>
> I use the similar code for audio and it does not work.  It plays the
> song but does not show the controller
>
> set the showController of the templatePlayer to true
> play audioclip "My Clip"
>
> -------------------------
> My problem is:  I have a list of 9 songs and I want to show them in a
> list and let user click on one song at a time and play it
>
> I use the scrolling list field to display those songs.  Here is the  
> code
> of the scrolling list field:
>
> on mouseup
>     global gClickVar
>     select the clickLine
>     put word 2 of the clickLine into gClickVar
>
>    -- get the song name
>    put line gClickVar of field "audioList" into gClickVar
>    play audioClip gClickVar looping
>
> end mouseup
>
> ----------------------
> I create a play button.  Here is the code for the play button (it  
> works
> fine):
>
> on mouseUp
>   global gClickVar
>      play audioClip gClickVar looping
> end mouseUp
>
> -------------------------
> I also create the stop, prev and next button.  They works fine
>
> -----------------------
> My problem is I don't know how to create the volume slider to control
> the volume
>
> -----------------------
> I use this code for the pause button:
> on mouseUp
>     global gClickVar
>     play pause audioClip gClickVar
> end mouseUp
>
> It stops the song and plays the beginning of the song when I  
> release the
> mouse.  I want to pause it and click again to continue play (not
> beginning)
>
> ---------------------
> so that why I am trying to use this code so I don't have to worry  
> about
> volume and stuff...:
>
> set the showController of the templatePlayer to true
> play audioclip "My Clip"
>
> but it does not work
>
>
> ---------
> Does the player object play the imported song (import as a control) or
> only play songs on the hard drive that you insert in the source
> (C:\audio\songs....)
>
>
> Please help me.  Anyone has any idea?  Thank you


Best Regards from Paris,

Eric Chatonet.
----------------------------------------------------------------
So Smart Software

For institutions, companies and associations
Built-to-order applications: management, multimedia, internet, etc.
Windows, Mac OS and Linux... With the French touch

Free plugins and tutorials on my website
----------------------------------------------------------------
Web site        http://www.sosmartsoftware.com/
Email        [hidden email]/
Phone        33 (0)1 43 31 77 62
Mobile        33 (0)6 20 74 50 86
----------------------------------------------------------------

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

RE: showController for audio question???

Ban Nguyen
In reply to this post by Ban Nguyen

Since you do not work with player objects you should change the line to:

on scrollbardrag t_value
    set the playloudness to t_value
end scrollbardrag

----->It works.  Thanks

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

I use this code for the pause button:
on mouseUp
    global gClickVar
    play pause audioClip gClickVar
end mouseUp

It stops the song and plays the beginning of the song when I release the
mouse.  I want to pause it and click again to continue play (not
beginning)

Klaus, do you have any idea?  Thanks

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

BTW, is there anyway to build the progress bar.  User can slide back and
forward and see how far the song is playing.

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






_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: showController for audio question???

Klaus major-k
Hi Ban,

> Since you do not work with player objects you should change the  
> line to:
>
> on scrollbardrag t_value
>     set the playloudness to t_value
> end scrollbardrag
>
> ----->It works.  Thanks
>
> ----------------------------------------------------------------------
> --
> --
>
> I use this code for the pause button:
> on mouseUp
>     global gClickVar
>     play pause audioClip gClickVar
> end mouseUp
>
> It stops the song and plays the beginning of the song when I  
> release the
> mouse.  I want to pause it and click again to continue play (not
> beginning)
>
> Klaus, do you have any idea?  Thanks

yes, new day, new idea :-)
(It is 10:30 AM here in germany)

There are some ways to do this, and it depends if you are using icons  
or just
label in your buttons...

But here is an idea that will always work (hopefully ;-)

on mouseUp
     global gClickVar
     if the sound is "done" then
        play resume ac gClickVar
     else
       play pause ac gClickVar
    end if
end mouseUp

ac = abbrev. for audioClip

This will check, if the sound is NOT playing (= "done"),
which menas it has been stopped somehow and will (try) to
resume the sound.

Otherwise (sound is PLAYING = NOT "done") it will simply pause
the sound...

NOT tested yet!


Regards

Klaus Major
[hidden email]
http://www.major-k.de

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution