AnsweredAssumed Answered

VRf-VEE_Sound

Question asked by VRFuser on Mar 27, 1997
send q VRf-VEE_Sound vrf kraft@kodak.com

from: Greg Goebel / HP-MXD
      gvg@lvld.hp.com / 970-679-3030 / FAX 970-679-5971
to:   Bill Kraft
date: Friday, 28 March 1997 0952 MST

> Dear VEE Users,     
>
> Is there a way to get reasonable programmable sound (without a sound
> card) from either of these two VECTRA PC's using VEE?  IF not, what
> type of sound card is recommended to take full advantage of the BEEP
> object and what does VEE need to find it?

OK, this is crazy stuff ... old 16-bit VEE had direct beeper hardware access,
but on Win32 Microsoft yanked this capability.  All we had instead was an
API call that supposedly generates a simple BEEP, but its operation appears
to be uncertain.

So the only real sure option is to make calls to the Windows sound system
through Execute Program (we hope to streamline this a bit presently).  At
this point VEE neither knows nor cares what sound system is being used, if
it works with Windows it works with VEE (any old SoundBlaster will do).

Please see notes below.  Yes, I know this is a pain but it's not going to go
away very soon.

[%%] regards -- gvg

--------------------------------- cut here ----------------------------------


[21.13] PLAYING SOUND FILES WITH VEE

* I had been puzzling over the problem of how to get VEE to play sound files
-- typically .WAV files -- on a PC for a long time, but though it was
possible to use the VEE Execute Program object to run the Windows Media
Player ("mplayer.exe") with a .WAV file as a parameter, it would play the
file -- and then stay on the screen.

A customer on the VEE Reflector (bless him and it!) came up with the
solution ... you have to invoke it as:

   c:winmplayer.exe -play -close c:sounds igboom.wav 

-- assuming, of course, that the "mplayer.exe" file is in a directory named
"c:win" and you want to play a .WAV file named "c:sounds igboom.wav".
This brings up the Media Player, which then plays the .WAV file -- and goes
away.

In practice, the VEE code to play different .WAV would look something like
this:

               +-------+
               | Start |
               +---+---+
                   |
  +----------------+----------------+
  |              Text               |
  +---------------------------------+
  | c:winmplayer.exe -play -close +--+   +-------------+
  +---------------------------------+  |   |   Formula   |
                                       +-->+-------------+
  +------------------------+               | A + " " + B +--+
  |          Text          |           +-->+-------------+  |
  +------------------------+           |                    |
  | c:sounds igboom.wav  +-----------+                    |
  +------------------------+                                |
                                                            |
                     +--------------------------------------+
                     |
                     |   +------------------------------------------------+
                     |   |             Execute Program (PC)               |
                     |   +---------+-----------------------------------+--+
                     |   |         | Run Style:          [ Minimized ] |  |
                     +-->| Command | Wait for prog exit: [ Yes ]       |  |
                         |         | Prog with params:   [ c:winmp ] |  |
                         |         | Working directory:  [           ] |  |
                         +---------+-----------------------------------+--+

Notice how the "Run Style" is set to "Minimized" to ensure that the Media
Player only comes up as an icon.

We have successfully run this program on both Win3 and WinNT using PCs with
sound cards.  Experiments with the so-called "Sound Driver for the PC
Speaker" didn't provide very good results -- but then that particular driver
doesn't provide very good results in general.

[%%]

Outcomes