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: 51
Default Playing a sequence of WAV files

I'm creating a text-to-speach algorhythm in Excel which strings
together WAV files to form sentences. The concept works great, but I'm
needing to insert a delay between every word to let the system finish
saying the word before moving to the next one.

Using the code at the bottom of this post (plus a WAIT subroutine), I
need to do something like this:

PlaySound "this"
wait 0.5
PlaySound "is"
wait 0.3
PlaySound "a"
wait 0.3
PlaySound "test"
wait 0.5

** Is there any way to make the system wait until it is done playing a
WAV file before playing the next one so I don't need to figure out and
specify all the delays?

** What does "Alias" mean in the declaration?
** Can someone explain the parameters in "PlaySoundA" (i.e. lpszName,
hModule, dwFlags)?

Thanks!

John


___

Public Declare Function PlayWav Lib "winmm.dll" _
Alias "PlaySoundA" (ByVal lpszName As String, _
ByVal hModule As Long, ByVal dwFlags As Long) As Long
Public Const SND_ASYNC = &H1
Public Const SND_FILENAME = &H20000

___

Public Sub PlaySound(Optional SoundName As String =
"confirm_blip.wav")

On Error GoTo Skip_Sound

#If Win32 Then
Call PlayWav(ThisWorkbook.Path & "\SM Sounds\" & SoundName, 0&,
SND_FILENAME Or SND_ASYNC)
#End If
' Only can play sounds on PC

Skip_Sound:

End Sub

 
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 mp3 files on user input Maxi[_2_] Excel Programming 4 August 17th 06 03:50 PM
Playing .mp3 files based on user input Maxi[_2_] Excel Programming 3 August 13th 06 03:29 PM
Playing .wav files (why do a few cause warning messages?) Cybert Excel Programming 0 October 19th 04 09:38 PM
Macro to "Stop Playing" wave files yo beee Excel Programming 2 November 10th 03 07:05 PM


All times are GMT +1. The time now is 10:17 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"