Jump to content

Media Framework


cppman
 Share

Recommended Posts

Media Framework

Hi. This is my first version of the Media Framework, I plan to add more features, but now it is pretty basic.

Some functions include:

Play($sFile);$sFile is a string to the mp3/file
Stop($sSong);stops playing the specified song
Pause($sSong);pauses the specified song
Resume($sSong);resume the specified song
GetAlbumArt($sFile);file to download album art for
SetVolume($sSong, $nnVolume);sets the volume of the specified song, $nnVolume is an integer between 0.0 and 1.0
SetPan($sSong, $nnPan);sets the pan for the specified song. -1.0 to 1.0
SetPitch($sSong, $nnPitch);sets the pitch for the specified song. .5 is twice slow the speed, 0 is original speed, 1 is twice as fast.
GetLength($sSong);returns the length of the song in samples
IsSeekable($sSong);returns true if the song is seekable
IsPlaying($sSong);returns if $sSong is playing
SetRepeating($sSong);boolean > set wether the song should repeat or not when done playing.
IsRepeating($sSong);returns true if the specified song has the repeating propertie set to true.
GetChannelCount($sSong);returns the number of channels in the song
GetSampleRate($sSong);gets the sample rate of the specified song.

You can play mutiple songs simutaniously, and each song has its own individual properties such as, volume, pan, pitch and so on. Nothing is global, if you wish to change the volume you must specifically change the songs volume.

e.g.

$song = Play("mysong.mp3")
$song2 = play("myothersong.mp3")
SetVolume($song, .5)
SetVolume($song2, 1)

This uses Matt Campbells COM Audio. Includes 2 dlls that must be copied to the systen directory and then COMAudio.dll needs to be registered. You can use the automatic tool in the .zip file, or do it manually. Instructions in the README.txt.

Hope this helps anyone that is making a media player, game, or anything else. :wacko:

*Credits: CHRIS95219 and i used Lazycat's MP3TagInfo UDF.

BIG NOTE! if you used "MyWay Media Player" and you got an Object error. This might not work for you. :D

in the sample.au3 - the line where it says, "Play("song.mp3")" it should be changed to "Play("song.wav")" or whatever song you want to use to test it...

Download Here:

Edited by CHRIS95219
Link to comment
Share on other sites

  • 9 months later...

But your script gives errors :)

Try Changing the line in MediaFramework.au3

Global $nVolume, $nPan, $nPitch, $nLength, $nChannelCount, $nSampleRate, $sCurSong, $objService, $objDeviceoÝ÷ ÚÚºÚ"µÍÛØ[ ÌÍÛÛ[YK ÌÍÛ[ ÌÍÛ]Ú   ÌÍÛ[Ý   ÌÍÛÚ[[ÛÝ[ ÌÍÛØ[T]K    ÌÍÜÐÝÛÛË    ÌÍÛØÙXÙK  ÌÍÛØ]XÙK   ÌÍÜ

What other errors are you getting?

EDIT: ALSO READ THE README!!!!

In order to use the ActiveX/COM object used by this media framework both of these files must be moved to the Windows System Directory.

audiere.dll -> C:\windows\system32

COMAudio.dll -> C:\windows\system32

after you move those files, now click start->run-> and type in:

regsvr32 c:\windows\system32\COMAudio.dll

Edited by Bert
Link to comment
Share on other sites

Run this from the script dir to install it :)

FileCopy (@ScriptDir & "\COMAudio.dll", @SystemDir)
FileCopy (@ScriptDir & "\audiere.dll", @SystemDir)
ShellExecute ("regsvr32", "c:\windows\system32\COMAudio.dll")

Simple really :D

EDIT: Yes... Yes it does error allot. Mostly object errors??

Edited by Bert
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...