Objects not displayed with wav sound

bpk1970

New member
Joined
Jul 16, 2009
Messages
4
Programming Experience
Beginner
Hey all,

With VB6 and VB9, I continue to have problems displaying images on a form while playing wav files (either by API call or by My.Computer.Audio.Play method).

I set up a loop to display pictureboxes on a form (card images), with a wav sound file that is supposed to be played each time a picturebox is displayed. However the pictureboxes won't display until after the loop finishes and the sounds have been played several times in series:


Example code:

For I = 0 To 3

picBox(I).Visible = True ' picBox is an object collection of pictureboxes

My.Computer.Audio.Play(My.Resources.Deal, _
AudioPlayMode.WaitToComplete)

Next


The series of 4 Deal.wav sounds are heard, but the cards aren't displayed until afterwards.

How can I synchronize the sounds to the images? I'd like to show 1 picBox, have a sound, then show the next picBox and so on.

Any advice would be greatly appreciated. I had this problem with VB6 and had to do some extraneous steps to fix the problem. I can't solve the dilemma with VB9.


Thanks,

BK
 
hi blackbyte

Thanks for the advice, but I tried playing the wav as a background. It doesn't work for the following reasons:

1. I get a distorted, high pitched beep instead of the wav sound.

2. The pictureboxes still don't appear until after the sound is done, and the pictureboxes appear altogether, instead of individually.

I still haven't found a solution to this problem in VB9.


bk
 
Back
Top