Article View: comp.os.ms-windows.programmer.tools
Article #95Re: VB and sound
From: Galen Raben
Date: Tue, 04 Aug 1992 15:33
Date: Tue, 04 Aug 1992 15:33
47 lines
1835 bytes
1835 bytes
In comp.os.ms-windows.programmer.tools, sp@cs.brown.edu (Seth Padowitz) writes:
>Just thought I'd point out that the samples given for using
>mciSendString were incorrect.
>The samples should have used mciExecute(), since it only takes a
>single string parameter. mciSendString takes 4 parameters.
[...]
>Seth
OOPS! You are absolutely correct!! Got my wires crossed again :-)
The correct global declaration should be:
Declare Function mciExecute Lib "MMsystem"(ByVal lpCoMMand As String) As Integer
the examples should be:
In your program to play TADA.WAV...
Ret% = mciExecute("Open /windows/tada.wav alias TALK")
Ret% = mciExecute("Play TALK")
... go do something else (you shouldn't close till its finished playing)
Ret% = mciExecute("Close TALK")
to play "CANYON.MID":
Ret% = mciExecute("Open /windows/canyon.mid alias MUSIC")
Ret% = mciExecute("Play MUSIC")
... go do something else...
Ret% = mciExecute("Close MUSIC")
to pause it
Ret% = mciExecute("Pause MUSIC")
to resume playing
Ret% = mciExecute"Play MUSIC"
------------------------------------
That should fix it! You may choose to place the message (between the quotes)
into a string. Also you will note that I used the full path on the filename,
for some reason occassionally it can't find the path (unless the full path is
used) - your mileage could vary...
Apologies for the error and bandwidth!
- Galen -
Technical Details
Message-ID:
<36720007@hpgrla.gr.hp.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!elroy.jpl.nasa.gov!usc!sdd.hp.com!hpscdc!hplextra!hpfcso!hpgrla!galenrReferences:
<1992Jul21.223156.21625@cs.brown.edu>Show Full Headers
Complete Article Headers
From: galenr@hpgrla.gr.hp.com (Galen Raben) Date: Tue, 4 Aug 1992 15:33:32 GMT Subject: Re: VB and sound Message-ID: <36720007@hpgrla.gr.hp.com> Organization: Hewlett-Packard, Greeley, CO Path: arc1-ca.pugleaf.net!sparky!uunet!elroy.jpl.nasa.gov!usc!sdd.hp.com!hpscdc!hplextra!hpfcso!hpgrla!galenr Newsgroups: comp.os.ms-windows.programmer.tools References: <1992Jul21.223156.21625@cs.brown.edu> Lines: 48