Jump to content
Sign in to follow this  
Insolence

MCISendString

Recommended Posts

Insolence

I can't seem to play any of my .mp3 files, I got it working with .wav files though:

mciSendString("play C:\The_Beatles-Abbey_Road-17-Her_Majesty.Mp3")
Sleep(100)
mciSendString("play " & FileGetShortName(@WindowsDir & "\Media\ringin.wav"))
Sleep(1500)

Func mciSendString($str)
   $ret = DLLCall("winmm.dll","int","mciSendString","str",$str, "str", "" ,"int", 65534,"hwnd",0)
   If NOT @ERROR Then
        Return $ret[2]
   Else
        SetError(1)
        Return ""
   EndIf
EndFunc

Try using this file:

http://insolence9.com/music/The_Beatles-Ab...Her_Majesty.Mp3


"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.

Share this post


Link to post
Share on other sites
Jos

I can't seem to play any of my .mp3 files, I got it working with .wav files though:

mciSendString("play C:\The_Beatles-Abbey_Road-17-Her_Majesty.Mp3")
Sleep(100)
mciSendString("play " & FileGetShortName(@WindowsDir & "\Media\ringin.wav"))
Sleep(1500)

Func mciSendString($str)
   $ret = DLLCall("winmm.dll","int","mciSendString","str",$str, "str", "" ,"int", 65534,"hwnd",0)
   If NOT @ERROR Then
        Return $ret[2]
   Else
        SetError(1)
        Return ""
   EndIf
EndFunc

Try using this file:

http://insolence9.com/music/The_Beatles-Ab...Her_Majesty.Mp3

<{POST_SNAPBACK}>

Works fine on my XP Pro sp2 with both 3.1.1.0 and Beta...

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

Share this post


Link to post
Share on other sites
Insolence

Which works?

It doesn't play the actual song for me, but it does play the ringing...


"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.

Share this post


Link to post
Share on other sites
Jos

Which works?

It doesn't play the actual song for me, but it does play the ringing...

<{POST_SNAPBACK}>

Both... it plays the MP3 and sounds the wav file during the playback of the mp3..

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

Share this post


Link to post
Share on other sites
Insolence

That's very strange =\

What could I be missing?


"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.

Share this post


Link to post
Share on other sites
Jos

That's very strange =\

What could I be missing?

<{POST_SNAPBACK}>

location of the mp3 ?

I copied into the same directory as the test script and ran it like:

mciSendString("play The_Beatles-Abbey_Road-17-Her_Majesty.Mp3")


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

Share this post


Link to post
Share on other sites
svennie

Some computers will stop the executing of a DLL function when the program itself is closed, you must keep it open.

An example is by adding While 1 and WEnd

mciSendString("play C:\The_Beatles-Abbey_Road-17-Her_Majesty.Mp3")
Sleep(100)
mciSendString("play " & FileGetShortName(@WindowsDir & "\Media\ringin.wav"))
Sleep(1500)

Func mciSendString($str)
   $ret = DLLCall("winmm.dll","int","mciSendString","str",$str, "str", "" ,"int", 65534,"hwnd",0)
   If NOT @ERROR Then
        Return $ret[2]
   Else
        SetError(1)
        Return ""
   EndIf
EndFunc
While 1
;just keep executing
WEnd

Sorry for my English, I'm Dutch... =DMedia UDFINet Adv UDF

Share this post


Link to post
Share on other sites
Insolence

I tried moving the MP3 into the same dir and I also tried running the infinite loop, nothing.

Thanks guys, I wonder what else could be wrong?


"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.

Share this post


Link to post
Share on other sites
MHz

You have installed a third party MP3 codec?

The MP3 codec installed would be non-compliant audio codec for windows specifications. Try to change the priorty of the Fraunhofer MP3 codec in Audio Codecs Properties to a higher level then the other MP3 codec.

Share this post


Link to post
Share on other sites
Insolence

Where are Audo Codec Properties? Also, that sounds like it may be the problem =\

EDIT:

I set the priority to 1 and it still doesn't work... ugh

Edited by Insolence

"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.

Share this post


Link to post
Share on other sites
MHz

You could try to unregister then register the mp3 files.

The filenames for mp3 are:

L3codecx.ax

L3codeca.acm or L3codecp.acm

Use "regsvr32 /u filename" to unregister, then "regsvr32 filename" to register. This may fix the issue, with any luck.

Edited by MHz

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  

×