Results 1 to 3 of 3

Thread: Wav's and MCI Control

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Location
    Westminster, Md.
    Posts
    163
    When playing wav files with the Multi Media control, you have to load each file individually. I've noticed that there is a delay time while the file loads if you change it...iS there a way to 'pre load' the wav's so that there's no delay time before it plays?

    Thanks,

  2. #2
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892

    Thumbs up API!

    If you just need to play WAVs, you don't need a huge MCI control. The API can do it quickly and efficiently.

    Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
    Public Const SND_ASYNC = &H1
    Public Const SND_NODEFAULT = &H2


    Put the above code in the General Declarations of a module. Then, to play a file, use:

    Call sndPlaySound("C:\MyFile.wav", SND_ASYNC Or SND_NODEFAULT)

    To stop all wave sounds currently playing, use:

    Call sndPlaySound(vbNullString, SND_NODEFAULT)

    The next step would be getting rid of your MCI control and cursing the day you heard of it.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Location
    Westminster, Md.
    Posts
    163

    Great!

    Works very well... Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width