Sounding WAV files using Windows 3.1 API

Sounding WAV files using Windows 3.1 API

Post by Tim Curr » Wed, 14 Feb 1996 04:00:00



How do I open a WAV file and make it transmit through my sound card
using Windows 3.1 API ?

Will I have a problem if I transmit a WAV one right after the other ?
Do I need to pause between sounds.

Please email back. Thanks in advance.

--

"Off the keyboard, thru the router, over the bridge, nothing but net!"

Tim Curry                         ::::::    ::::::    ::::::
Engineer                         ::        ::        ::
205/876.7219 (voice)             ::        ::        ::
205/842.0969 ( fax )            Computer   Sciences Corporation
                                 ::             ::   ::
                                 ::             ::   ::
                                  ::::::   ::::::     ::::::

 
 
 

Sounding WAV files using Windows 3.1 API

Post by Raymond Ch » Thu, 15 Feb 1996 04:00:00


On Tue, 13 Feb 1996 13:52:21 -0600, Tim Curry


>How do I open a WAV file and make it transmit through my sound card
>using Windows 3.1 API ?

Use the sndPlaySound() function to play WAV files through the sound card.

Quote:>Will I have a problem if I transmit a WAV one right after the other ?
>Do I need to pause between sounds.

It depends on which flags you pass to sndPlaySound().  If you say SND_SYNC,
then sndPlaySound() will not return until the sound has finished playing.  If
you say SND_ASYNC, then sndPlaySound() will start the sound and then return
immediately.  If you go for SND_ASYNC, then you need to set up your own
mechanism for making sure your sounds don't overlap.

 
 
 

1. HELP - How to embed .WAV file data into Windows 3.1 w/Borland 4.0

HELP.

I am using Borland C++ 4.0 with OWL2.  I am trying to add some sound (.WAV file
data) objects to a Windows 3.1 executable.

All documentation I have been able to get from Borland and from Compuserve has
been completely useless.  I did locate a function called sndPlaySound that
looks like it would do what I need, but it seems to be a Win32 (Windows95)
only function.

Has anyone successfuly completed this before?  How was it done.  If you could
supply or point to an example C++ source code block, or let me know what
functions I need to be using, it would be great.  After 8 hours of searching
all my Borland docs (which do not even mention the function), and the online
help (which has not example or indication which library these functions reside
in), I'm about ready to tell my boss we just can't do it!  Of course, I'd like
to avoid that.

An externaly loaded .WAV file would not be acceptable to the spec. since it
will be an attention getting application, and the users will delete the .WAV
file as soon as they find it... they are just that way.

Any help is of course, appreciated.

Thank you _very_ much, in advance.

        Either e-mail or posting are totaly acceptable.

 **********************************************************************
 **  Dave DeMartini              **         North American           **
 **  Hewlett Packard Co.          **    Distribution Organization     **

 **********************************************************************
 **     Views expressed above are not neccessarily those of HP       **
 **********************************************************************

2. Minimum system disk size for VMS 4.7 / VAX-11/780 ?

3. Playing a .wav file in Windows 3.1

4. Help with ClosedBSD

5. Playing a WAV File using Sound Recorder

6. FS: 3640 REV 3.1 68040/25 mhz for A3000/A4000 $250

7. Printing using the new Windows 3.1 API

8. SNMP for OS-9?

9. TAPI 3.1 and WAV files

10. Playing WAV files in 3.1

11. getting the size of wav file recorded using dialogic API.

12. FM Sound Under Window 3.1 (Programming Question)

13. Differences in Windows Nt and Windows 3.1 apis?