HELP!!!! Multimedia MCI Control 
Author Message
 HELP!!!! Multimedia MCI Control

I am trying to use the MCI control to allow my app to play various *wav
files.

It seems I am doing something wrong, or the MCI control has a mind of
its own.  for some reason, I am not able to change the wave file--if i
try to load a new sound, the control either loads the last wave file
played, or it doesn't load anything.

Can someone please show me how to switch back and forth between 2
different wav files using code?

Any help would really be appreciated.

Thanks, Clark



Tue, 15 Jun 1999 03:00:00 GMT  
 HELP!!!! Multimedia MCI Control

Quote:
> I am trying to use the MCI control to allow my app to play various *wav
> files.

> It seems I am doing something wrong, or the MCI control has a mind of
> its own.  for some reason, I am not able to change the wave file--if i
> try to load a new sound, the control either loads the last wave file
> played, or it doesn't load anything.

> Can someone please show me how to switch back and forth between 2
> different wav files using code?

> Any help would really be appreciated.

> Thanks, Clark

If you are designing an app that utilizes sound effects, I suggest using
the Win32 API function 'sndPlaySound'. To save you some time, I have
included the declare as well as the constants for the function.

Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal
lpszSoundName As String, ByVal uFlags As Long) As Long

'  flag values for uFlags parameter
Public Const SND_SYNC = &H0         '  play synchronously (default)
Public Const SND_ASYNC = &H1         '  play asynchronously

Public Const SND_NODEFAULT = &H2         '  silence not default, if sound
not found

Public Const SND_MEMORY = &H4         '  lpszSoundName points to a memory
file
Public Const SND_ALIAS = &H10000     '  name is a WIN.INI [sounds] entry
Public Const SND_FILENAME = &H20000     '  name is a file name
Public Const SND_RESOURCE = &H40004     '  name is a resource name or atom
Public Const SND_ALIAS_ID = &H110000    '  name is a WIN.INI [sounds] entry
identifier

Public Const SND_ALIAS_START = 0  '  must be > 4096 to keep strings in same
section of resource file

Public Const SND_LOOP = &H8         '  loop the sound until next
sndPlaySound
Public Const SND_NOSTOP = &H10        '  don't stop any currently playing
sound
Public Const SND_VALID = &H1F        '  valid flags          / ;Internal /

Public Const SND_NOWAIT = &H2000      '  don't wait if the driver is busy

Public Const SND_VALIDFLAGS = &H17201F    '  Set of valid flag bits.
Anything outside
                                    '  this range will raise an error
Public Const SND_RESERVED = &HFF000000  '  In particular these flags are
reserved

Public Const SND_TYPE_MASK = &H170007



Tue, 15 Jun 1999 03:00:00 GMT  
 HELP!!!! Multimedia MCI Control

Clark, if you want to use the MCI.OCX the comes with VB 4.0, here is some
code that works to play WAV files.

    MMControl1.DeviceType = "WaveAudio"    
    MMControl1.filename = sFullyQualifiedFileName
    MMControl1.Command = "Open"
    MMControl1.From = 1
    MMControl1.To = MMControl1.Length
    MMControl1.Command = "Play"

I would recommend not using the MCI.OCX, but rather to use the API call
mciSendString.  You can do just about anything with mciSendString.  It
takes a little more work, but you can create a reusable class object that
uses the mciSendString to play just about anything.

--
Marty Pavlovic
Andersen Consulting

St. Charles Illinois, U.S.A.

These views are my own and do not represent the views of Andersen
Consulting LLP.



Quote:
> I am trying to use the MCI control to allow my app to play various *wav
> files.

> It seems I am doing something wrong, or the MCI control has a mind of
> its own.  for some reason, I am not able to change the wave file--if i
> try to load a new sound, the control either loads the last wave file
> played, or it doesn't load anything.

> Can someone please show me how to switch back and forth between 2
> different wav files using code?

> Any help would really be appreciated.

> Thanks, Clark



Tue, 15 Jun 1999 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Please help me with MCI Multimedia Control Error #322

2. Help: MCI Multimedia control

3. Help with the Multimedia MCI control

4. MCI Multimedia Control help

5. Multimedia control question (MCI Control)

6. Multimedia MCI Control

7. VB6,Multimedia MCI control ,and voice

8. MCI Multimedia Control

9. Trouble saving a wav file using MCI Multimedia Control

10. Saving a file with the MCI Multimedia Control

11. MCI Multimedia Control

12. The multimedia MCI control - anything better then this?

 

 
Powered by phpBB® Forum Software