au3scr Posted December 22, 2007 Share Posted December 22, 2007 I need help here, my media player dont work correctly It plays well wav and mid but it dont play mp3 How i make it play mp3? expandcollapse popup#include <GUIConstants.au3> #include <Sound.au3> $path = "" $Paused=False #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 459, 132, 193, 125) $Play = GUICtrlCreateButton("Play", 16, 96, 75, 25, 0) $Stop = GUICtrlCreateButton("Stop", 96, 96, 75, 25, 0) $pause = GUICtrlCreateButton("Pause", 176, 96, 75, 25, 0) $Slider1 = GUICtrlCreateSlider(8, 32, 446, 29) $Time = GUICtrlCreateLabel("Time", 16, 64, 27, 17) $Progress1 = GUICtrlCreateSlider(344, 96, 78, 24,$PBS_SMOOTH ,$WS_EX_ACCEPTFILES ) $Volume = GUICtrlCreateLabel("Volume", 304, 96, 39, 17) $way = GUICtrlCreateInput ($path,10,10,200,20) GUISetState(@SW_SHOW) $filemenu = GUICtrlCreateMenu("File") $MenuItem3 = GUICtrlCreateMenuItem("Open", $filemenu) #EndRegion ### END Koda GUI section ### $i = 50 GUICtrlSetData ($Progress1,$i) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $MenuItem3 $path = FileOpenDialog("Select file:","", "(*.*)") If Not @error Then $Sound= _SoundOpen($path) Case $Play _SoundPlay($Sound) Case $Stop _SoundStop($Sound) Case $Progress1 $vol = GUICtrlRead ($Progress1) SoundSetWaveVolume ($vol) Case $pause If $Paused=False Then _SoundPause($Sound) $Paused=True Else _SoundResume($Sound) $Paused=False EndIf EndSwitch WEnd Link to comment Share on other sites More sharing options...
au3scr Posted December 22, 2007 Author Share Posted December 22, 2007 How to make it play mp3? Link to comment Share on other sites More sharing options...
au3scr Posted December 22, 2007 Author Share Posted December 22, 2007 bump Link to comment Share on other sites More sharing options...
Developers Jos Posted December 22, 2007 Developers Share Posted December 22, 2007 It works fine.... just select a WAV file and try it SciTE4AutoIt3 Full installer Download page  - Beta files    Read before posting   How to post scriptsource   Forum etiquette Forum Rules  Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Developers Jos Posted December 22, 2007 Developers Share Posted December 22, 2007 It works fine.... just select a WAV file and try it SciTE4AutoIt3 Full installer Download page  - Beta files    Read before posting   How to post scriptsource   Forum etiquette Forum Rules  Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
au3scr Posted December 22, 2007 Author Share Posted December 22, 2007 But how i can play mp3? Link to comment Share on other sites More sharing options...
MiXS Posted December 22, 2007 Share Posted December 22, 2007 It's very very easy ! expandcollapse popup#include <GUIConstants.au3> #include <Sound.au3> $path = "" $Paused=False #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 459, 132, 193, 125) $Play = GUICtrlCreateButton("Play", 16, 96, 75, 25, 0) $Stop = GUICtrlCreateButton("Stop", 96, 96, 75, 25, 0) $pause = GUICtrlCreateButton("Pause", 176, 96, 75, 25, 0) $Slider1 = GUICtrlCreateSlider(8, 32, 446, 29) $Time = GUICtrlCreateLabel("Time", 16, 64, 27, 17) $Progress1 = GUICtrlCreateSlider(344, 96, 78, 24,$PBS_SMOOTH ,$WS_EX_ACCEPTFILES ) $Volume = GUICtrlCreateLabel("Volume", 304, 96, 39, 17) $way = GUICtrlCreateInput ($path,10,10,200,20) GUISetState(@SW_SHOW) $filemenu = GUICtrlCreateMenu("File") $MenuItem3 = GUICtrlCreateMenuItem("Open", $filemenu) #EndRegion ### END Koda GUI section ### $i = 50 GUICtrlSetData ($Progress1,$i) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $MenuItem3 $path = FileOpenDialog("Select file:","", "(*.wav;*.mp3)") If Not @error Then $Sound= _SoundOpen($path) Case $Play _SoundPlay($Sound) Case $Stop _SoundStop($Sound) Case $Progress1 $vol = GUICtrlRead ($Progress1) SoundSetWaveVolume ($vol) Case $pause If $Paused=False Then _SoundPause($Sound) $Paused=True Else _SoundResume($Sound) $Paused=False EndIf EndSwitch WEnd Link to comment Share on other sites More sharing options...
Nahuel Posted December 22, 2007 Share Posted December 22, 2007 No no, you see.. you can select any type of files, but his computer won't play mp3's (works fine with mine though). If you change _SoundPlay() with SoundPlay() then it works, but then you can't use functions like _SoundPause, _SoundResume, etc... Link to comment Share on other sites More sharing options...
MiXS Posted December 22, 2007 Share Posted December 22, 2007 So it is strange because with what I replaced on its script everything walks home. I don't understand in no way what it searches has make then! PS: Sorry for the english but i'm french Link to comment Share on other sites More sharing options...
au3scr Posted December 22, 2007 Author Share Posted December 22, 2007 But why i cant play mp3? other players does it Link to comment Share on other sites More sharing options...
MiXS Posted December 22, 2007 Share Posted December 22, 2007 You can't play mp3 with this ? (changed by me) expandcollapse popup#include <GUIConstants.au3> #include <Sound.au3> $path = "" $Paused=False #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 459, 132, 193, 125) $Play = GUICtrlCreateButton("Play", 16, 96, 75, 25, 0) $Stop = GUICtrlCreateButton("Stop", 96, 96, 75, 25, 0) $pause = GUICtrlCreateButton("Pause", 176, 96, 75, 25, 0) $Slider1 = GUICtrlCreateSlider(8, 32, 446, 29) $Time = GUICtrlCreateLabel("Time", 16, 64, 27, 17) $Progress1 = GUICtrlCreateSlider(344, 96, 78, 24,$PBS_SMOOTH ,$WS_EX_ACCEPTFILES ) $Volume = GUICtrlCreateLabel("Volume", 304, 96, 39, 17) $way = GUICtrlCreateInput ($path,10,10,200,20) GUISetState(@SW_SHOW) $filemenu = GUICtrlCreateMenu("File") $MenuItem3 = GUICtrlCreateMenuItem("Open", $filemenu) #EndRegion ### END Koda GUI section ### $i = 50 GUICtrlSetData ($Progress1,$i) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $MenuItem3 $path = FileOpenDialog("Select file:","", "(*.wav;*.mp3)") If Not @error Then $Sound= _SoundOpen($path) Case $Play _SoundPlay($Sound) Case $Stop _SoundStop($Sound) Case $Progress1 $vol = GUICtrlRead ($Progress1) SoundSetWaveVolume ($vol) Case $pause If $Paused=False Then _SoundPause($Sound) $Paused=True Else _SoundResume($Sound) $Paused=False EndIf EndSwitch WEnd Because for me it's work ! Link to comment Share on other sites More sharing options...
Nahuel Posted December 22, 2007 Share Posted December 22, 2007 Dude, that doesn't make any difference... it's not a problem of the FileOpenDialog filter. It's a problem with _SoundPlay(). Link to comment Share on other sites More sharing options...
MiXS Posted December 22, 2007 Share Posted December 22, 2007 What ? He can't read his music ? have you the codec mp3? Link to comment Share on other sites More sharing options...
au3scr Posted December 22, 2007 Author Share Posted December 22, 2007 I can read music.. I play most music with windows mediaplayer And VLC media player can play everything Link to comment Share on other sites More sharing options...
MiXS Posted December 22, 2007 Share Posted December 22, 2007 So, corrected script walks correctly then you should be able to read your mp3! but if you cannot play mp3 with this corrected script i can't help you more ! sorry :s 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