LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default Wavfile playing trubcated

I posted a similar Q a couple of weeks ago and Jacob Skaria pointed me to
MrExcel's site. I'm now using the code from there to play wavfiles, but the
problem hasn't changed. When I play a wavfile at the start of a procedure it
will (more often than not) only play the first tenth of a second (subsequent
statements of
ANY kind seem to terminate it). Other times (in the SAME subroutine, and
without code changes) it will play completely. If I play the Wavfile at the
end of a procedure then it always plays all of it.

I have (from MrExcel)

Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal
lpszSoundName As String, ByVal uFlags As Long) As Long
Public Const SND_FILENAME = &H20000
Public Const SND_SYNC = &H0
Public Const SND_ASYNC = &H1
Public Const SND_NODEFAULT = &H2
Public Const SND_MEMORY = &H4
Public Const SND_LOOP = &H8
Public Const SND_NOSTOP = &H10
Dim WAVFile As String

and then a series of:
Sub G02_WAV_CHIMES()
WAVFile = "C:\0. QUO VADIS\SOUNDS\chimes.wav"
Call sndPlaySound(WAVFile, SND_ASYNC Or SND_FILENAME)
End Sub

What can be causing this intermittent problem please?
Is there something that needs to be cleared (or whatever) before playing a
WAV? Brett



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Detecting the actual playing or NOT playing of a WAV file Bajbaj Excel Discussion (Misc queries) 0 October 24th 07 09:16 PM
Playing sound in VBA Pete[_22_] Excel Programming 3 October 10th 05 02:01 PM
Playing around with Syntax Hari Prasadh Excel Programming 2 January 29th 05 06:40 AM
playing sound??? tess457[_6_] Excel Programming 2 October 20th 04 11:50 AM
ThisWorkbook.Path & "\" & .... not WAVFile, but AVI file... ste mac Excel Programming 0 May 31st 04 10:22 AM


All times are GMT +1. The time now is 07:57 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"