will88 Posted October 12, 2008 Share Posted October 12, 2008 (edited) I made a gui and a button, when I click the button it has you select the file that you want to soundplay() I need it to wait until the soundplay() is over before it continues, Ive tried soundplay("whatever", 1) but it does soundplay() and pauses the whole script so I can't click anything else on the Gui while its playing that song $song = FileOpenDialog("Title","","(*.*)") iniwrite(@ScriptDIr & "\myini.ini", "Section", "CurrentSong",$song) soundplay($song) iniwrite(@ScriptDIr & "\myini.ini", "Section", "CurrentSong",""); clears current song(because its not playing) iniwrite(@ScriptDIr & "\myini.ini", "Section", "PreviousSong",$song);makes it the previous song reason I need it to wait in that part is because if the 'previous song' button is clicked it will always be the current song that it will play. So it won't work to go back a song if I click the button. anyone have an idea of what I can do to make this work? Edited October 12, 2008 by will88 Password-Keeper Link to comment Share on other sites More sharing options...
james3mg Posted October 12, 2008 Share Posted October 12, 2008 I made a gui and a button, when I click the button it has you select the file that you want to soundplay() I need it to wait until the soundplay() is over before it continues, Ive tried soundplay("whatever", 1) but it does soundplay() and pauses the whole script so I can't click anything else on the Gui while its playing that song $song = FileOpenDialog("Title","","(*.*)") iniwrite(@ScriptDIr & "\myini.ini", "Section", "CurrentSong",$song) soundplay($song) iniwrite(@ScriptDIr & "\myini.ini", "Section", "CurrentSong",""); clears current song(because its not playing) iniwrite(@ScriptDIr & "\myini.ini", "Section", "PreviousSong",$song);makes it the previous song reason I need it to wait in that part is because if the 'previous song' button is clicked it will always be the current song that it will play. So it won't work to go back a song if I click the button. anyone have an idea of what I can do to make this work?If I remember right, there's a sound udf that would allow you to get the length of a sound file...then you could set a timer, and once enough time passed that the song is now over, activate the "previous song" button...is that what you mean? "There are 10 types of people in this world - those who can read binary, and those who can't.""We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true." ~Robert Wilensky0101101 1001010 1100001 1101101 1100101 1110011 0110011 1001101 10001110000101 0000111 0001000 0001110 0001101 0010010 1010110 0100001 1101110 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 12, 2008 Moderators Share Posted October 12, 2008 Good morning,The UDF is Sound.au3 and is to be found in the "Include" folder of the AutoIt installation. It lets you control the sound files much more comprehensively than SoundPlay. Look in the Helpfile just under SoundPlay for the "_Sound....." commands. I have a background mp3 player running on my machine at the moment which uses this UDF to do practically everything you could ever want.And if you want to be really up-to-date, RazerM has just released a new beta version, which you can find here:http://www.autoitscript.com/forum/index.ph...45&start=45This new version was developed (with a little help from me) to give the correct duration of VBR mp3s and more testing is always welcome.Your 'play the previous track rather than replay the current' command is something I was thinking about adding to my player. I was looking at the same logic as you, but I intended to keep the current/previous track names as internal variables - only using a single IniWrite function when the player closes. I already IniWrite the name and position of the current file (among other things) on exit so that the player can resume the track on opening - adding another key for the previous track is just a question of adding a line.Good luck, and please ask again if you need any assistance with Sound.au3.M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now