Sign in to follow this  
Followers 0
DanBoy

HOW TO MAKE PAUSE BUTTON ON MP3 PLAYER?...

15 posts in this topic

HOW TO MAKE PAUSE BUTTON ON MP3 PLAYER?...


Share this post


Link to post
Share on other sites



not ipod:S.. i talk about autoitv3.. mp3 player


Share this post


Link to post
Share on other sites

I afraid you will get more silly answers until you ask a "real" question.....

I mean we are pretty clever in AutoIt3 but we are still learning on the clearvoiant front !


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

You do know that it's possible to toggle capslock off right ? It's not too popular to

write in caps, so I would suggest you to behave at least just as decently as you

might would have in real life. If you were yelling like that in real life I'm pretty

sure you would be put in mental hospital.

Btw, why do you write in caps ? Do you think you're so damn important that everybody

should be interested and listen to what you have to say ? Writing in caps might make

it easier to notice whatever you write, but it doesn't make you more popular.

To answer your question, although I kind of don't want to, you can start by getting

http://www.autoitscript.com/fileman/users/Helge/udfs/Sound.au3 I made a while back ago. Do some reading in there and you will be able

to pause, seek and more. Now, I think you got enough attention for today and to be

honest you got a lot more than you actually deserved.

Share this post


Link to post
Share on other sites

HOW TO MAKE PAUSE BUTTON ON MP3 PLAYER?...

LOOK ME EVERYBODY, I CAN TYPE ALL CAPS TOO

AND LEAVE OUT MOST OF THE SUBJECTS AND PREPOSITIONS MY SENTENCES AND MAYBE EVEN SOME CONJUNCTIONS

I'M GONNA ANSWER YOUR QUESTION WITH A RESPONSE ABOUT AS SPECIFIC AS YOUR QUESTION

*Turns off caps*

wow, I though i could write this all in caps, but doing it pisses myself off :P

Anyway,

Try adding the code for a pause button to your current code, that should work. :nuke:

Share this post


Link to post
Share on other sites

DanBoy, put this in your script so you can pause it with the pause button..

$paused=""
hotkeyset("{pause}","togglepause")
func togglepause()
$paused=not $paused
while $paused
sleep(50)
wend
endfunc

Now just press Pause and whatever your script is doing, E.G. playing MP3s, will be paused.

Press Pause again to unpause it.

Share this post


Link to post
Share on other sites

DanBoy, put this in your script so you can pause it with the pause button..

$paused=""
hotkeyset("{pause}","togglepause")
func togglepause()
$paused=not $paused
while $paused
sleep(50)
wend
endfunc

Now just press Pause and whatever your script is doing, E.G. playing MP3s, will be paused.

Press Pause again to unpause it.

:P you're sure that the music will pause when you hit the pause button ?

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

It works in all of the scripts I've tried it in.

Is it working for you DanBoy?

Share this post


Link to post
Share on other sites

It works in all of the scripts I've tried it in.

Is it working for you DanBoy?

So you're saying that if I start a sound with SoundPlay your script could help me pause it ?

Damn..would you mind showing us an example that does that because I can't see how that

would work :P

Share this post


Link to post
Share on other sites

It will put the script into a while loop that does nothing, and won't end it until you unpause it, so it effectively pauses everything in the script from running.

Except maybe adlibenable. Use adlibdisable to fix that. :P

Share this post


Link to post
Share on other sites

It will put the script into a while loop that does nothing, and won't end it until you unpause it, so it effectively pauses everything in the script from running.

Except maybe adlibenable. Use adlibdisable to fix that. :P

@Azu, it will pause the script NOT the music playing in the background that was started with SoundPlay, because that plays in the background ...

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

It will put the script into a while loop that does nothing, and won't end it until you unpause it, so it effectively pauses everything in the script from running.

Except maybe adlibenable. Use adlibdisable to fix that. :P

Only logical thing I can get out of your way of thinking is that you have a special

version of AutoIt where SoundPlay sings the lines in your script, and where maybe

the pitch follow the indentation. So, if the script is trapped in a empty loop then

there will be silence. Hmm, that makes sort of sence I guess.

Edit : I forgot that you don't use indentation so just forget about that pitch thing...

Edited by Helge

Share this post


Link to post
Share on other sites

nah its don't work:S


Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

I've fixed some typos in my UDFs and they should now work. Download them and

save the below code as a script in the same folder as the UDFs where you then run it.

#include "Sound.au3"

SoundPlay(@WindowsDir & "\media\tada.wav") ; starts playing

Sleep(100) ; plays for 100msec
_SoundPause() ; pauses
Sleep(1000) ; silence for 1 sec
_SoundStart(-1, -1, True) ; resumes and plays to end

Edit : I went thru the UDFs and cleaned it up a little bit while fixing other bugs as well.

Hopefully I can forget about these UDFs now :P

Edited by Helge

Share this post


Link to post
Share on other sites

You might want to take a look at my Sound UDF


My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0