|
-
Jan 4th, 2001, 10:09 PM
#1
Thread Starter
New Member
Hi there,
I'm already using api to play .wav sounds one at a time, and my question is, is it possible to play two sounds at once? Also, is there a simple way to replay a sound when it's finished? Thanks!
To be or not to be, that is the pencil. And yet also pointless.
-
Jan 5th, 2001, 05:10 AM
#2
PowerPoster
i think this will do, yet it depands on the soundcard that you using. It should work for SoundBlaster SoundCard.
Code:
Option Explicit
Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Private Declare Function PlaySound Lib "winmm.dll"
Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long
Private Const SND_ASYNC = &H1 ' Play asynchronously Private Const SND_NODEFAULT = &H2 ' Do not use default sound.
Private Sub Form_Load()
PlaySound "C:\welcome1.wav", 0&, SND_ASYNC Or SND_NODEFAULT
PlaySound "C:\welcome2.wav", 0&, SND_ASYNC Or SND_NODEFAULT
End Sub
-
Jan 23rd, 2001, 08:32 AM
#3
Hi,
I am using a Multimedia MCI control (MMControl) to play music. The problem is that I don't know how to automatically replay it. I mean with only 7 seconds of music repeat it constantly.
Thank you very much.
-
Jan 23rd, 2001, 09:47 AM
#4
PowerPoster
Saiz, you can use the MMControl1_PlayCompleted event in the MMControl to replay the audio file rite.
Hope this can help you too.
-
Jan 23rd, 2001, 10:43 AM
#5
Chris I tried something better, I copied the code from your previous reply and added the following:
PlaySound "C:\Wmpaud9.wav", 0&, SND_ASYNC Or SND_LOOP
Now it replay constantly.
But still a problem: I don't know how to stop it!!!
Any suggestion?
-
Jan 24th, 2001, 09:49 AM
#6
PowerPoster
Saiz, Here the sample on how to stop a wavw audio file play by the PlaySound API.
Code:
Option Explicit
Private Const SND_PURGE = &H40 ' purge non-static events for task
Private Const SND_ASYNC = &H1 ' play asynchronously
Private Const SND_LOOP = &H8 ' loop the sound until next sndPlaySound
Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long
Private Sub Command1_Click()
PlaySound "C:\IR_BEGIN.WAV", 0&, SND_ASYNC Or SND_LOOP
End Sub
Private Sub Command2_Click()
PlaySound "C:\IR_BEGIN.WAV", 0&, SND_PURGE
End Sub
-
Jan 24th, 2001, 04:54 PM
#7
Lively Member
Where can I get Multimedia MCI control (MMControl) ??
Thanks
Andreas
[email protected]
-
Jan 24th, 2001, 06:38 PM
#8
-
Jan 25th, 2001, 09:23 AM
#9
PowerPoster
All you need is juz add the Multimedia control into your project.
References|Component|Microsoft Myltimedia Control 6.0 (SP3)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|