Achilles Posted October 22, 2009 Share Posted October 22, 2009 Running something as simple as this is causing errors on both Vista 64bit and 7 64bit when running the latest beta or just version 3.3.0.0. I end up viewing a message about driver errors. Is this something anybody else is seeing, or if this is just my computer? Oddly, with just version 3.3.0.0 it says it opens but it doesn't play.. And the sound length function just returns 0. Limiter had a post about this same issue a year ago but he didn't find a solution. Anybody have any ideas? #include <Sound.au3> ;open sound file : must be modified if run under Vista $sound = _SoundOpen('N:\Music\ABBA\Greatest Hits\Dancing Queen .mp3') If @error = 2 Then MsgBox(0, "Error", "The file does not exist") Exit ElseIf @extended <> 0 Then $extended = @extended ;assign because @extended will be set after DllCall $stText = DllStructCreate("char[128]") $errorstring = DllCall("winmm.dll", "short", "mciGetErrorStringA", "str", $extended, "ptr", DllStructGetPtr($stText), "int", 128) MsgBox(0, "Error", "The open failed." & @CRLF & "Error Number: " & $extended & @CRLF & "Error Description: " & DllStructGetData($stText, 1) & @CRLF & "Please Note: The sound may still play correctly.") Else MsgBox(0, "Success", "The file opened successfully" & @CRLF & _SoundLength($sound)) EndIf _SoundPlay($sound, 1) _SoundClose($sound) My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
Achilles Posted October 23, 2009 Author Share Posted October 23, 2009 Could someone at least see if sound functions are working with the latest beta with .mp3 files? I don't know if this is a windows 7 thing or just my computer. All you need to do is run this: #include <Sound.au3> ;open sound file : must be modified if run under Vista $file = FileOpenDialog('helllo.....', @MyDocumentsDir & "", "Media (*.mp3)", 1 + 4 ) $sound = _SoundOpen($file) If @error = 2 Then MsgBox(0, "Error", "The file does not exist") Exit ElseIf @extended <> 0 Then $extended = @extended ;assign because @extended will be set after DllCall $stText = DllStructCreate("char[128]") $errorstring = DllCall("winmm.dll", "short", "mciGetErrorStringA", "str", $extended, "ptr", DllStructGetPtr($stText), "int", 128) MsgBox(0, "Error", "The open failed." & @CRLF & "Error Number: " & $extended & @CRLF & "Error Description: " & DllStructGetData($stText, 1) & @CRLF & "Please Note: The sound may still play correctly.") Else MsgBox(0, "Success", "The file opened successfully") EndIf _SoundPlay($sound, 0) $splashtext = SplashTextOn("Current Position", _SoundPos($sound, 1), 300, 90, Default, Default, 18, Default, 55) While 1 Sleep(100) ControlSetText("Current Position", "", "Static1", _SoundPos($sound, 1)) If _SoundPos($sound, 2) >= _SoundLength($sound, 2) Then ExitLoop WEnd _SoundClose($sound) My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
FuryCell Posted October 23, 2009 Share Posted October 23, 2009 Could someone at least see if sound functions are working with the latest beta with .mp3 files? I don't know if this is a windows 7 thing or just my computer. All you need to do is run this: #include <Sound.au3> ;open sound file : must be modified if run under Vista $file = FileOpenDialog('helllo.....', @MyDocumentsDir & "", "Media (*.mp3)", 1 + 4 ) $sound = _SoundOpen($file) If @error = 2 Then MsgBox(0, "Error", "The file does not exist") Exit ElseIf @extended <> 0 Then $extended = @extended ;assign because @extended will be set after DllCall $stText = DllStructCreate("char[128]") $errorstring = DllCall("winmm.dll", "short", "mciGetErrorStringA", "str", $extended, "ptr", DllStructGetPtr($stText), "int", 128) MsgBox(0, "Error", "The open failed." & @CRLF & "Error Number: " & $extended & @CRLF & "Error Description: " & DllStructGetData($stText, 1) & @CRLF & "Please Note: The sound may still play correctly.") Else MsgBox(0, "Success", "The file opened successfully") EndIf _SoundPlay($sound, 0) $splashtext = SplashTextOn("Current Position", _SoundPos($sound, 1), 300, 90, Default, Default, 18, Default, 55) While 1 Sleep(100) ControlSetText("Current Position", "", "Static1", _SoundPos($sound, 1)) If _SoundPos($sound, 2) >= _SoundLength($sound, 2) Then ExitLoop WEnd _SoundClose($sound) That code works fine on my system with an mp3 from my itunes folder. I am also running windows 7 btw. HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code. Link to comment Share on other sites More sharing options...
JohnOne Posted October 23, 2009 Share Posted October 23, 2009 Tryed on my lappy, win7 works fine AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
sniper120 Posted January 30, 2010 Share Posted January 30, 2010 Tryed on my lappy, win7works fineHm... I'm having the same problem.. Both SoundPlay functions don't play the mp3 file. I used the same script posted as well as the one in the Help File.Win XP 32-bit Link to comment Share on other sites More sharing options...
James Posted January 30, 2010 Share Posted January 30, 2010 Achilles, I received an error too: Windows 7 (32Bit) AU3 Version: 3.3.4.0 James Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
sniper120 Posted January 30, 2010 Share Posted January 30, 2010 Achilles, I received an error too: Windows 7 (32Bit) AU3 Version: 3.3.4.0 James I'm using 3.3.0.0... I noticed that when I used shellexecute to "open" the mp3 file it worked. SoundPlay doesn't want to play the file.. =( Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 30, 2010 Moderators Share Posted January 30, 2010 Hmmm,As I write I am listening to music on my Autoit-coded player using Sound.au3 without a problem. It was last compiled with 3.3.4.0 and I am running Vista HP SP2.The built-in SoundPlay command also works without problem.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...
sniper120 Posted January 30, 2010 Share Posted January 30, 2010 (edited) Hmmm, As I write I am listening to music on my Autoit-coded player using Sound.au3 without a problem. It was last compiled with 3.3.4.0 and I am running Vista HP SP2. The built-in SoundPlay command also works without problem. M23 Yea I noticed that with all the mp3 players (with the autoit fourms, things get posted 300 times) they called the _SoundPlay() function or the built-in one. Strange that some are able to get sound. It's not the sound, it won't play. The script kills it self, but it should wait till it's done. EDIT: Hm.. Wave files play.. But not MP3s... EDIT 2 : Even WMA files play for me.. #include <Sound.au3> ;open sound file $sound = _SoundOpen(@WindowsDir & "\media\Windows XP Startup.wav", "Startup") If @error = 2 Then MsgBox(0, "Error", "The file does not exist") Exit ElseIf @error = 3 Then MsgBox(0, "Error", "The alias was invalid") Exit ElseIf @extended <> 0 Then $extended = @extended ;assign because @extended will be set after DllCall $stText = DllStructCreate("char[128]") $errorstring = DllCall("winmm.dll", "short", "mciGetErrorStringA", "str", $extended, "ptr", DllStructGetPtr($stText), "int", 128) MsgBox(0, "Error", "The open failed." & @CRLF & "Error Number: " & $extended & @CRLF & "Error Description: " & DllStructGetData($stText, 1) & @CRLF & "Please Note: The sound may still play correctly.") Else MsgBox(0, "Success", "The file opened successfully") EndIf _SoundPlay($sound, 1) _SoundClose($sound) Edited January 30, 2010 by sniper120 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 30, 2010 Moderators Share Posted January 30, 2010 (edited) sniper120,You will not be surprised to hear that your script works perfectly for me - once I give it a valid filename and adjust the syntax for 3.3.4.0.I helped rewrite quite a lot of Sound.au3 for 3.3.4.0 (which is why the syntax is different ) - but all versions of it use the winmm.dll to play the sound files. What @error and @extended are you getting back from _SoundOpen in your script?M23Edit: tpying! Edited January 30, 2010 by Melba23 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...
sniper120 Posted January 30, 2010 Share Posted January 30, 2010 (edited) sniper120, You will not be surprised to hear that your script works perfectly for me - once I give it a valid filename and adjust the syntax for 3.3.4.0. I helped rewrite quite a lot of Sound.au3 for 3.3.4.0 (which is why the syntax is different ) - but all versions of it use the winmm.dll to play the sound files. What @error and @extended are you getting back from _SoundOpen in your script? M23 Edit: tpying! I just updated to the latest stable version am I'm going to try the sound play function again =) Hm.. It works now =) I just have to fix my loop so it plays till it's done. I enabled the "wait" option but the script keeps going =( EDIT: Scratch that, it's not pausing to play the song and I don't hear anything... Update: For whatever reason, It plays .wma files correctly! I'll try another mp3 file. While True Get_Stream_File() Read_Stream() ;ShellExecuteWait(@ScriptDir & "\play.mp3", "", "", "", @SW_HIDE) SoundPlay(@ScriptDir & "\play.mp3", 1) ; <-- Hm.. 1 is there ;Call("Play_Song") _RunDOS("cls") WEnd Edited January 30, 2010 by sniper120 Link to comment Share on other sites More sharing options...
James Posted January 30, 2010 Share Posted January 30, 2010 @All,Weird, the first song I picked didn't work. I tried again and it worked fine.Something isn't quite right there!James Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
sniper120 Posted January 30, 2010 Share Posted January 30, 2010 @All,Weird, the first song I picked didn't work. I tried again and it worked fine.Something isn't quite right there!James Tell you what.. I'll update to WMP 11 and see what happens.. Link to comment Share on other sites More sharing options...
sniper120 Posted January 30, 2010 Share Posted January 30, 2010 Tell you what.. I'll update to WMP 11 and see what happens..Nope... Same problem..XD I had WMP 11 but reinstalled it. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 30, 2010 Moderators Share Posted January 30, 2010 All,There is much confusion here.I am happy to help with the Sound.au3 functions, i.e. all those with a leading underscore. Like everyone else apart from the Devs, I have no knowledge of the built-in SoundPlay function.sniper120,You appear to be using both SoundPlay and _SoundPlay in your posts. Are they both broken for you or does one work?If you are using _SoundPlay, are you opening the file first with _SoundOpen? If so, are you getting an @error from _SoundOpen? And if you do, what is the value of @extended?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...
wakillon Posted September 28, 2010 Share Posted September 28, 2010 (edited) Sorry to re open an old topic but i don't find any solution...This morning i want to try Speaking Clock of XY16But like sniper120, soundPlay or _soundPlay don't work for me.wav file are played but not mp3 !_soundPlay give me thisIt's the same error than jamesBrook post.I have no problem in my device manager and i have verified, i have well winmm.dll in system 32 folder.Temporarily i replace by "ShellExecute ( @TempDir & "\" & $file & ".mp3", "", "", "", @SW_HIDE )"It works, but defaut player stay open after playing...If someone have an idea... Edited September 28, 2010 by wakillon AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 28, 2010 Moderators Share Posted September 28, 2010 wakillon, There are no mp3 files in the speaking clock package - what mp3 files are you trying to play? 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...
wakillon Posted September 28, 2010 Share Posted September 28, 2010 wakillon,There are no mp3 files in the speaking clock package - what mp3 files are you trying to play?M23Sorry it's Speaking Clock of Werty in the same Topic ! AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 28, 2010 Moderators Share Posted September 28, 2010 wakillon,Works fine for me - using the built-in SoundPlay and modifying the script to use Sound.au3.There was a problem with Sound.au3 and sound files in the Windows\Media folder. I raised Ticket #1707 and advertised it here, but that seems to have nothing to do with this case.Sorry I cannot help any more.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...
Moderators Melba23 Posted September 28, 2010 Moderators Share Posted September 28, 2010 wakillon,Continuing from the Sound.au3 topic: That dialog is not generated by Sound.au3 - that is Windows telling you a driver for something external to the OS has shut down. But the MCI dll is internal. Please try opening the recalcitrant mp3 file with _SoundOpen and let me know what @error and @extended vales you get - that will help us see if it is problem with opening the file or whether you have another problem elsewhere in your system. 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