Re: playing mp3 files within windows

From: Leon Wagner <leon_at_forth.com>
Date: Sat, 16 Oct 2004 14:17:12 -0700

I just happened to be here converting French radio broadcasts into MP3
files, so I thought I'd give it a try. First of all, don't forget to read
the documentation about the functions you're trying to use:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/ht
m/_win32_mci_functions.asp

Not sure what you think the purpose is for the parameter RETURNVALUE, but it
is not what the name implies. That parameter is supposed to be for a
callback address (or good old NULL if none). And you don't need
RETURNSTRING if you're not expecting (or don't care about) a returned
string.

This worked the first time on my machine (Windoze XP SP2):

LIBRARY WINMM.DLL
4 IMPORT: mciSendString

Z" PLAY C:\TEMP\JOURNAL.MP3" 0 0 0 mciSendString

And to stop it:

Z" CLOSE C:\TEMP\JOURNAL.MP3" 0 0 0 mciSendString

> -----Original Message-----
> From: sftalk-bounce_at_forth.com [mailto:sftalk-bounce_at_forth.com]On Behalf
> Of Tom Dixon
> Sent: Saturday, October 16, 2004 12:06 PM
> To: sftalk_at_forth.com
> Subject: [sftalk] Re: playing mp3 files within windows
>
>
>
> Greetings,
>
> I've found out how to do it a long time ago. Basically you can
> use the windows
> MCI api. I suspect that all your mp3 players use the same api as
> well. I've
> used it for much more as well - I've played avi files to the
> console and all
> sorts of things, so you have access to alot more than just mp3
> and wave. Here
> is the sample:
>
> \ how to play an mp3 file in 6 lines of code
> library winmm.dll
> 4 import: mciSendString
> create returnstring 256 allot
> 0 value returnvalue
> : mcicommand returnstring 255 returnvalue mciSendString ;
>
> an example would be: z" play c:\mymp3.mp3" mcicommand
> and you should hear something.
>
>
> -Tom Dixon
>
>
> Quoting Roger Dube <rogerdube_at_dathq.com>:
>
> > I know how to play wav files using a Windows api, such as:
> >
> > ABSENT PlaySound [IF] LIBRARY WINMM.DLL
> >
> > 3 IMPORT: PlaySound [THEN]
> >
> > : tada ( --)
> > z" c:\windows\media\tada.wav" 0 SND_FILENAME SND_SYNC OR
> PlaySound DROP ;
> >
> > Has anyone been successful in finding a way to play an mp3 file
> in a similar
> > fashion? The standard shell commands to mp3 players usually
> have windows
> > that pop up during play, whereas the above plays without any window
> > distracting the operator.
> >
> >
> > -- Roger
> > --------------------------------------------
> > Dr. Roger Dube
> > President and Chief Science Officer
> > Digital Authentication Technologies, Inc.
> > 561.392.7404 (office)
> > 561.892.2474 (eFax)
> > RogerDube_at_datHQ.com
> >
> > http://www.datHQ.com
> >
> > PO Box 811564
> > Boca Raton, FL 33481-1564
> >
> > ----------------------------------------------------------------------
> > This email message is for the sole use of the intended
> recipient(s) and may
> > contain confidential and privileged information. Any
> unauthorized review,
> > use, disclosure or distribution is prohibited. If you are not
> the intended
> > recipient, please contact the sender by reply email and destroy
> all copies
> > of the original message. Any views expressed in this message
> are those of
> > the individual sender, except where the sender specifically
> states them to
> > be the views of Digital Authentication Technologies, Inc.
> >
> >
> > ----------------------------------------------------------------------
> > sftalk_at_forth.com The SwiftForth programming discussion email list
> > To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
> > For list command help, send subject "help" to sftalk-request_at_forth.com
> > Message archives are located at http://www.forth.com/archive/sftalk
> > ----------------------------------------------------------------------
> > This list is a forum for SwiftForth users. For product support and bug
> > reports, please send email to support_at_forth.com
> > ----------------------------------------------------------------------
> >
> >
>
>
> --
>
> ----------------------------------------------------------------------
> sftalk_at_forth.com The SwiftForth programming discussion email list
> To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
> For list command help, send subject "help" to sftalk-request_at_forth.com
> Message archives are located at http://www.forth.com/archive/sftalk
> ----------------------------------------------------------------------
> This list is a forum for SwiftForth users. For product support and bug
> reports, please send email to support_at_forth.com
> ----------------------------------------------------------------------
>
>

----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
For list command help, send subject "help" to sftalk-request_at_forth.com
Message archives are located at http://www.forth.com/archive/sftalk
----------------------------------------------------------------------
This list is a forum for SwiftForth users. For product support and bug
reports, please send email to support_at_forth.com
----------------------------------------------------------------------
Received on Sat Oct 16 2004 - 14:17:29 PDT


Subscribe to our e-mail list service. It's free for all SwiftForth and SwiftX users!

This archive was generated 09-Feb-2012. Archive updated nightly.