News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Repeating a song

Started by Farabi, May 27, 2007, 01:32:47 AM

Previous topic - Next topic

Farabi

How to repeat a song using MCI command?

Here is my code.

.data
szMP3Format db "MPEGVideo",0

.code
LoadMP3File proc hWin:dword,NameOfFile:dword
LOCAL mciOpenParms:MCI_OPEN_PARMS,mciPlayParms:MCI_PLAY_PARMS
LOCAL MidDeviceID:dword

mov eax,hWin       
mov mciPlayParms.dwCallback,eax
mov eax,OFFSET szMP3Format
mov mciOpenParms.lpstrDeviceType,eax
mov eax,NameOfFile
mov mciOpenParms.lpstrElementName,eax
invoke mciSendCommand,0,MCI_OPEN,MCI_OPEN_TYPE or MCI_OPEN_ELEMENT,ADDR mciOpenParms
mov eax,mciOpenParms.wDeviceID
mov MidDeviceID,eax

invoke mciSendCommand,MidDeviceID,MCI_PLAY,MCI_NOTIFY,ADDR mciPlayParms
mov eax,MidDeviceID

ret
LoadMP3File endp

PlayFile proc MidDeviceID:dword
LOCAL mciPlayParms:MCI_PLAY_PARMS
invoke mciSendCommand,MidDeviceID,MCI_PLAY,MCI_NOTIFY,ADDR mciPlayParms
ret
PlayFile endp

RepeatFile proc MidDeviceID:dword
LOCAL mciPlayParms:MCI_PLAY_PARMS
; Only repeating it 2 times and close
Invoke mciSendCommand, MidDeviceID, MCI_SEEK, MCI_SEEK_TO_START, addr mciPlayParms
Invoke mciSendCommand, MidDeviceID, MCI_PLAY, MCI_NOTIFY, addr mciPlayParms

ret
RepeatFile endp
Those who had universe knowledges can control the world by a micro processor.
http://www.wix.com/farabio/firstpage

"Etos siperi elegi"

Farabi

Ah finally I found my mistake.
Just ignore this thread. I hope you find the code usefull.
Those who had universe knowledges can control the world by a micro processor.
http://www.wix.com/farabio/firstpage

"Etos siperi elegi"