News:

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

Playing sound

Started by anuradha, July 20, 2007, 10:04:10 PM

Previous topic - Next topic

anuradha

hi
i have used playsound() Api to play wave sounds.Is it possiable to use this function to
play realmedia.If not is there other way to play realmedia???

thanx :P

u

Why not simply try doing so?
And if it doesn't work, install a codec to do so.
Please use a smaller graphic in your signature.

anuradha

hi
i allready  installed the codec but no results.is ther any way or api to play real media???
thanks :'( :'(

Proto

Not sure if this helps but I've used ShellExecuteA to play .mp3 files. It doesn't play within the program, as the default .mp3 player starts up but it does play them (and if the default player is WMP10 then it doesn't load a GUI, but it does start as a separate process). I'm not sure the same would happen with realmedia, but I'd assume that with a realmedia player it would in a similar way.

sinsi

Have a look at using mci commands - there was an earlier post somewhere that could play mp3's etc and it seems that if you have a codec installed the mci commands will play/show it.
Light travels faster than sound, that's why some people seem bright until you hear them.

Tedd

Create a normal window (hide it if you like) then use the following - it will play any supported media, as long as the required codecs are installed (the usual wav, mp3, etc, are installed by windows media player anyway, so they should all work.)

mci_play proc pFName:DWORD
    invoke MCIWndCreate, hWnd,hInstance,WS_CHILD or MCIWNDF_NOTIFYMODE or MCIWNDF_NOMENU or MCIWNDF_NOPLAYBAR,pFName
    mov hWndMCI,eax
    invoke SendMessage, hWndMCI,MCI_PLAY,0,0
    ret
mci_play endp

mci_stop proc
    invoke SendMessage, hWndMCI,WM_CLOSE,NULL,NULL
    ret
mci_stop endp

MCIWndCreate comes from msvfw32.inc; pFName is a pointer to the name of the file to be played; hWnd is the handle of your main window; hWndMCI is a variable to receive the handle of the new mci window, required for sending further commands to it.
No snowflake in an avalanche feels responsible.