Achilles Posted September 10, 2006 Share Posted September 10, 2006 No I'm joking... that would be a very stupid question. But I do have a question about playing music, I know that in the SoundPlay function the last parameter lets you choose if you want the script to wait for the music to be done before you can move on. However, I'm creating my own media playing system (more to see if I can then any other reason) and I was wondering, how can you tell a the program to play the next song in the list after the current one is done... remember that I don't want it to freeze up the whole thing until the song is done playing. Any help greatly appreciated as always, Piano_Man My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
Zedna Posted September 10, 2006 Share Posted September 10, 2006 Look at ObjCreate and MediaPlayer Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Jasio Posted September 10, 2006 Share Posted September 10, 2006 (edited) Not sure how relavant this is but it sounds like it would work? $a = 0 Do SoundPlay ( Song, 1 ) $a = 1 Until $a = 1 $a = 0 Do SoundPlay ( AnotherSong, 1 ) $a = 1 Until $a = 1 to read out the next song.. Then you would do SoundPlay($nsong, 1) Edited September 10, 2006 by Jasio Link to comment Share on other sites More sharing options...
theguy0000 Posted September 10, 2006 Share Posted September 10, 2006 ????? couldn't you just use SoundPlay ("A song", 1) SoundPlay ("Another song", 1) The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN Link to comment Share on other sites More sharing options...
Achilles Posted September 10, 2006 Author Share Posted September 10, 2006 ????? couldn't you just use SoundPlay ("A song", 1) SoundPlay ("Another song", 1) Well, I was hoping someone would read the whole paragraph. When the last parameter is set to "1" the whole thing freezes until the song is done. Keeping that in mind, anybody have an ideas concerning my first post. @Zedna: I don't get what objects are. The examples don't work on my computer either Piano_Man My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
Jasio Posted September 11, 2006 Share Posted September 11, 2006 Not sure, but if its possible to check length of the file using autoit/your player than you could have it count down. Link to comment Share on other sites More sharing options...
sohfeyr Posted September 11, 2006 Share Posted September 11, 2006 (edited) remember that I don't want it to freeze up the whole thing until the song is done playing. Try using StringSplit on a playlist, and putting that into a For Each loop. You can host the playlist using Adlib (no pun intended): Right off the top of my head: ; [Assign hotkeys] ; [Assign global player objects] Main() Func Main() ; [GUI code] ; [GUI message loop, including handling any buttons, which can be directed to the hotkey-assigned functions also] EndFunc Func PlayTheList() AdlibDisable() ; so it doesn't keep happening Dim $Playlist=StringSplit(GetPlayList(),@LF) Local $Song For $Song In $PlayList ; [Play code] EndFunc Func GetPlayList() ; [probably dependent on your GUI] EndFunc ; ... and the functions for the hotkeys, which will interact with the global player object. For example: Func Play() AdlibEnable("PlayTheList", 1000) EndFunc Func Pause() player.Pause() EndFunc Edit: Put code in AutoIt tags Edited September 11, 2006 by sohfeyr Mine:Time Functions - Manipulate the system clock! | WinControlList (WinGetClassList++) | .Net Setup Wrapper, Detect or install .Net | Writing and using a VB .NET COM object in AutoItNot mine, but highly recommended:AutoItTreeViewExtension plugin | Menu code | Callback helper dll | Auto3Lib - Control the uncontrollable | Creating COM objects in AutoIt | Using .Net framework classes in AutoIt Link to comment Share on other sites More sharing options...
Achilles Posted September 12, 2006 Author Share Posted September 12, 2006 Try using StringSplit on a playlist, and putting that into a For Each loop. You can host the playlist using Adlib (no pun intended): Right off the top of my head: ; [Assign hotkeys] ; [Assign global player objects] ... Hmm... could I have a simplified version of that please... I'm still kind of new at autoit and I don't get what the Adlib stuff does. I also don't really get how the rest of the stuff would help... I noticed you sort of built your suggestion around the way you though my code would look but it didn't really match so I've decided to post what I have so far. (For those of you who look at it it's pretty much done [for now] except I need to fix the add file part]) The script isn't directly related to the question I have but it might help. I just need to know a way to go to the next song when the one playing is done without freezing the whole thing... @ Jasio: I saw one person who had some stuff like that but it was very inconsistent as far as the length of the song (at least on my computer) Piano_Man My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
nfwu Posted September 12, 2006 Share Posted September 12, 2006 One (lazy) solution is to have 2 scripts: Subscript: #NoTrayIcon SoundPlay($CmdLineRaw, 1) ConsoleWrite("Done")oÝ÷ Øö«¶Ìj)Òr¸©µ«¢+ØÀÌØíM½¹¥¹¥Í ôQÉÕ(ÀÌØíÁ¥ôÀ)]¡¥±Ä((%9}Q=}A1e}M=9Q¡¸(ÀÌØíM½¹¥¹¥Í ô±Í(ÀÌØíÁ¥ôIÕ¸ ÅÕ½ÐíÍÕÍÉ¥ÁйáÅÕ½ÐìµÀìÅÕ½ÐìÅÕ½ÐìµÀí95}=}M=9°ÅÕ½ÐìÅÕ½Ðì°M]}!%°È¤(¹%((ìììIMP=1==@((%MÑI ÀÌØíÁ¥°Ð°QÉÕ¤ôÅÕ½Ðí½¹ÅÕ½ÐìQ¡¸ÀÌØíM½¹¥¹¥Í ôQÉÕ()]¹ #) TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode() Link to comment Share on other sites More sharing options...
dabus Posted September 12, 2006 Share Posted September 12, 2006 If you don't want to freeze your gui, use Opt("GUIOnEventMode", 1) You could use a $var to detect if soundplay is still active and update your gui via that $var. Link to comment Share on other sites More sharing options...
sohfeyr Posted September 15, 2006 Share Posted September 15, 2006 Hmm... could I have a simplified version of that please... I'm still kind of new at autoit and I don't get what the Adlib stuff does. I also don't really get how the rest of the stuff would help... I noticed you sort of built your suggestion around the way you though my code would look but it didn't really match so I've decided to post what I have so far. (For those of you who look at it it's pretty much done [for now] except I need to fix the add file part]) The script isn't directly related to the question I have but it might help. I just need to know a way to go to the next song when the one playing is done without freezing the whole thing... @ Jasio: I saw one person who had some stuff like that but it was very inconsistent as far as the length of the song (at least on my computer) Piano_Man The Adlib was so your GUI didn't freeze while the song was playing (cf dabus), and that way you could have Stop, Pause, etc. buttons that actually do something. Dabus' idea should work too. A "simplified version" would be pretty much the same, but calling PlayTheList directly instead on through the Adlib. ( Am I the only one who thinks it altogether fitting and funny to thread a media player with a command called Adlib? Or am I just showing my age?) If you aren't up to using Adlib, you probably won't be up to using DLLCall, but I'm just throwing this out as a possibility for other people who may look at this topic: check out PlaySound and sndPlaySound in winmm.dll, they have flags that support asynchronous playback. Probably not the best for use in a media player anyways, but it looks like they might be good for games or something. Mine:Time Functions - Manipulate the system clock! | WinControlList (WinGetClassList++) | .Net Setup Wrapper, Detect or install .Net | Writing and using a VB .NET COM object in AutoItNot mine, but highly recommended:AutoItTreeViewExtension plugin | Menu code | Callback helper dll | Auto3Lib - Control the uncontrollable | Creating COM objects in AutoIt | Using .Net framework classes in AutoIt 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