AetherMaster Posted March 17, 2010 Share Posted March 17, 2010 Hello everyone, I have a quick question for you. A while back, I found a function for looping a WAV sound: Func _SoundLoop($sSoundFile, $bLoop = True) Local Const $SND_ALIAS = 0x10000 Local Const $SND_ALIAS_ID = 0x110000 Local Const $SND_APPLICATION = 0x80 Local Const $SND_ASYNC = 0x1 Local Const $SND_FILENAME = 0x20000 Local Const $SND_LOOP = 0x8 Local Const $SND_MEMORY = 0x4 Local Const $SND_NODEFAULT = 0x2 Local Const $SND_NOSTOP = 0x10 Local Const $SND_NOWAIT = 0x2000 Local Const $SND_PURGE = 0x40 Local Const $SND_RESOURCE = 0x40004 Local Const $SND_SYNC = 0x0 If $bLoop Then DllCall('winmm.dll', 'int', 'PlaySoundA', 'str', $sSoundFile, 'int', 0, 'int', BitOR($SND_ASYNC, $SND_FILENAME, $SND_LOOP)) Else DllCall('winmm.dll', 'int', 'PlaySoundA', 'str', $sSoundFile, 'int', 0, 'int', $SND_FILENAME) EndIf EndFunc However, I'm looking to loop an MP3. Yes, I know that MP3s have a 'pause' that prevents stemless looping, but that doesn't matter to me. I'm willing to work with an audio glitch, since saving as an MP3 shaves off so much file size. Is there any way to loop an MP3? Thanks! Link to comment Share on other sites More sharing options...
jvanegmond Posted March 17, 2010 Share Posted March 17, 2010 I think this can do it: http://www.autoitscript.com/forum/index.php?showtopic=83481 Complicated stuff. github.com/jvanegmond Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted March 18, 2010 Share Posted March 18, 2010 Or look at "Sound Management" in the helpfile, it plays MP3. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
AetherMaster Posted March 18, 2010 Author Share Posted March 18, 2010 Manadar: Wow, that's complex... Sure there's no easier way?AdmiralAlkex: Which help file do you mean? Autoit's? I know that Autoit can play MP3s, but it can't loop them. Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted March 18, 2010 Share Posted March 18, 2010 AdmiralAlkex: Which help file do you mean? Autoit's? I know that Autoit can play MP3s, but it can't loop them.Think. You just need to play the file again if it ended, so do a "if _SoundStatus = "stopped" then playagain()" . BASS would work the same way if you use that. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
AetherMaster Posted March 18, 2010 Author Share Posted March 18, 2010 Think. You just need to play the file again if it ended, so do a "if _SoundStatus = "stopped" then playagain()" . BASS would work the same way if you use that.Wow. Now I feel stupid. Thanks for your help! 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