Jump to content

playing MP3s


sigil
 Share

Recommended Posts

I know that this has been discussed here before, but I searched the forums and didn't find any solutions that worked for my situation.

I've tried:

Run(@ComSpec & " /c " & 'c:\music\song.mp3', "", @SW_HIDE)

and

soundplay("c:\music\song.mp3",1)

and

soundplay("c:\music\song.mp3")
sleep(10000)

None of these produce errors; however, they don't produce any music, either.

Someone mentioned codecs. If that is the problem here, how do I check to see if I have the correct codec, and then acquire it if I don't have it?

Link to comment
Share on other sites

I know that this has been discussed here before, but I searched the forums and didn't find any solutions that worked for my situation.

I've tried:

Run(@ComSpec & " /c " & 'c:\music\song.mp3', "", @SW_HIDE)

and

soundplay("c:\music\song.mp3",1)

and

soundplay("c:\music\song.mp3")
sleep(10000)

None of these produce errors; however, they don't produce any music, either.

Someone mentioned codecs. If that is the problem here, how do I check to see if I have the correct codec, and then acquire it if I don't have it?

Try This.. Always works for me...

dllcall("winmm.dll","int","mciSendStringA","str","open " & """e:\music\endofall - Self Inflicted Damage.mp3""" &  " type MPEGVideo alias MP3File","str","","int",65534,"hwnd",0)
dllcall("winmm.dll","int","mciSendStringA","str","play MP3File","str","","int",65534,"hwnd",0)

I made a small UDF within my programs to run this when any file is opened

:whistle:

F@m!ly Guy Fr33k! - Avatar speaks for itself__________________________________________________________________________________________ite quotes... - Is your refrigerator running? If it is, It probably runs like you...very homosexually - Christians don't believe in gravity - Geeze Brian where do you think you are, Payless?- Show me potato Salad!__________________________________________________________________________________________Programs available - Shutdown timer[indent][/indent]
Link to comment
Share on other sites

Try This.. Always works for me...

dllcall("winmm.dll","int","mciSendStringA","str","open " & """e:\music\endofall - Self Inflicted Damage.mp3""" &  " type MPEGVideo alias MP3File","str","","int",65534,"hwnd",0)
dllcall("winmm.dll","int","mciSendStringA","str","play MP3File","str","","int",65534,"hwnd",0)

I made a small UDF within my programs to run this when any file is opened

:whistle:

I tried this, and got the same result: script starts, then terminates, no music played. I substituted the path for the song that I want to play, of course.
Link to comment
Share on other sites

It might sound a little insulting, but do you have any multimedia devices? Is your volume turned up? Did a crash happen when you executed the DLL?

:whistle:

F@m!ly Guy Fr33k! - Avatar speaks for itself__________________________________________________________________________________________ite quotes... - Is your refrigerator running? If it is, It probably runs like you...very homosexually - Christians don't believe in gravity - Geeze Brian where do you think you are, Payless?- Show me potato Salad!__________________________________________________________________________________________Programs available - Shutdown timer[indent][/indent]
Link to comment
Share on other sites

It might sound a little insulting, but do you have any multimedia devices? Is your volume turned up? Did a crash happen when you executed the DLL?

:whistle:

I'm not insulted. I have speakers; I usually play MP3s using Windows Media Player or other such applications . Volume's turned up to the max. No crash, the script just starts and ends--per SciTE, exit code is 0.

Link to comment
Share on other sites

What Windows media player version are you using , since i upgraded to 11 beta i couldt play any music files on my pc with scripts although copying the script and song to my laptop which is using WMP 10 then it works

My Scripts:Radioblog Club Music DownloaderOther stuff:Fun movieIm serious read the help file it helps :PFight 'Till you drop. Never stop, You Cant give up. Til you reach the top Fight! youÂ’re the best in town Fight!
Link to comment
Share on other sites

No drivers Missing? Winmm.dll isn't missing? (System directory), mmsystem isn't missing? (System directory), Multimedia Properties aren't greyed out? Windows Media Player needs a refresh install?

I'm just shooting out questions to maybe solve your problem

F@m!ly Guy Fr33k! - Avatar speaks for itself__________________________________________________________________________________________ite quotes... - Is your refrigerator running? If it is, It probably runs like you...very homosexually - Christians don't believe in gravity - Geeze Brian where do you think you are, Payless?- Show me potato Salad!__________________________________________________________________________________________Programs available - Shutdown timer[indent][/indent]
Link to comment
Share on other sites

What Windows media player version are you using , since i upgraded to 11 beta i couldt play any music files on my pc with scripts although copying the script and song to my laptop which is using WMP 10 then it works

Version 8.00.00.4477.

As far as AutoIt, I'm using version 3.2.0.1.

Link to comment
Share on other sites

No drivers Missing? Winmm.dll isn't missing? (System directory), mmsystem isn't missing? (System directory), Multimedia Properties aren't greyed out? Windows Media Player needs a refresh install?

I'm just shooting out questions to maybe solve your problem

Hmm...I have mmsystem.dll in c:\WINDOWS\system, but I don't have winmm.dll there. I have them both in c:\WINDOWS\system32.

Link to comment
Share on other sites

Hmm...I have mmsystem.dll in c:\WINDOWS\system, but I don't have winmm.dll there. I have them both in c:\WINDOWS\system32.

What version windows are you using?

The winmm.dll must be there in order for audio devices to work.

F@m!ly Guy Fr33k! - Avatar speaks for itself__________________________________________________________________________________________ite quotes... - Is your refrigerator running? If it is, It probably runs like you...very homosexually - Christians don't believe in gravity - Geeze Brian where do you think you are, Payless?- Show me potato Salad!__________________________________________________________________________________________Programs available - Shutdown timer[indent][/indent]
Link to comment
Share on other sites

What version windows are you using?

The winmm.dll must be there in order for audio devices to work.

XP. I copied winmm.dll from system32 to system, still nothing.

I've been trying to do a workaround by controlling Windows Media Player as a COM object, but I'm not very good with COM. I tried:

$player=objcreate("player")
$player.openplayer("c:\music\song.mp3")

but that didn't work, I just got this error:

Variable must be of type "Object".:

$player.openplayer("c:\music\song.mp3")

$player^ ERROR

What's the proper way to create a Windows Media Player object, and what's the method for playing an MP3?
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...