How to Play sounds and then move to a new Record withOUT errors 
Author Message
 How to Play sounds and then move to a new Record withOUT errors

I have put together a Math Quiz program for my son to improve his
multiplication. To make it more interesting I would like to add sounds after
each question is answered correctly and then move to the next record.

I have tried the following 2 code examples to play the sound and then move
to the next record. The sound will play fine, but if I choose to move to the
next record (and the sound is still playing) I get errors.

Note: For both examples "MySoundLocation" is a Randomly generated link to
WAV file on local C: drive)

Example 1:
    Dim RetValue As Variant
    RetValue = Shell("c:\WINDOWS\rundll32.exe
C:\WINDOWS\SYSTEM\amovie.ocx,RunDll /play /close " &
MySoundLocation, vbHide)

Example 2: (Me!SoundFile is an embeded WAV file on the form)
    Me!SoundFile.Class = "SoundRec"
    Me!SoundFile.Action = acOLECreateEmbed
    SoundFile.SourceDoc = MySoundLocation
    SoundFile.SourceItem = "Wave"
    SoundFile.Action = acOLEActivate

Here are 2 of the errors that I receive:
"The OLE server wasn't able to open the object"
or an error appears and the the sound repeats over the speakers and I have
to reboot the computer.

Any suggestions would be a great help!

Jerry



Sun, 05 Oct 2003 21:55:43 GMT  
 How to Play sounds and then move to a new Record withOUT errors
See http://www.mvps.org/access/api/api0011.htm

HTH,
Kevin Sullivan


Quote:
> I have put together a Math Quiz program for my son to improve his
> multiplication. To make it more interesting I would like to add sounds
after
> each question is answered correctly and then move to the next record.

> I have tried the following 2 code examples to play the sound and then move
> to the next record. The sound will play fine, but if I choose to move to
the
> next record (and the sound is still playing) I get errors.

> Note: For both examples "MySoundLocation" is a Randomly generated link to
> WAV file on local C: drive)

> Example 1:
>     Dim RetValue As Variant
>     RetValue = Shell("c:\WINDOWS\rundll32.exe
> C:\WINDOWS\SYSTEM\amovie.ocx,RunDll /play /close " &
> MySoundLocation, vbHide)

> Example 2: (Me!SoundFile is an embeded WAV file on the form)
>     Me!SoundFile.Class = "SoundRec"
>     Me!SoundFile.Action = acOLECreateEmbed
>     SoundFile.SourceDoc = MySoundLocation
>     SoundFile.SourceItem = "Wave"
>     SoundFile.Action = acOLEActivate

> Here are 2 of the errors that I receive:
> "The OLE server wasn't able to open the object"
> or an error appears and the the sound repeats over the speakers and I have
> to reboot the computer.

> Any suggestions would be a great help!

> Jerry



Mon, 06 Oct 2003 02:37:22 GMT  
 How to Play sounds and then move to a new Record withOUT errors
Thanks!

It worked wonderfully!



Quote:
> See http://www.mvps.org/access/api/api0011.htm

> HTH,
> Kevin Sullivan



> > I have put together a Math Quiz program for my son to improve his
> > multiplication. To make it more interesting I would like to add sounds
> after
> > each question is answered correctly and then move to the next record.

> > I have tried the following 2 code examples to play the sound and then
move
> > to the next record. The sound will play fine, but if I choose to move to
> the
> > next record (and the sound is still playing) I get errors.

> > Note: For both examples "MySoundLocation" is a Randomly generated link
to
> > WAV file on local C: drive)

> > Example 1:
> >     Dim RetValue As Variant
> >     RetValue = Shell("c:\WINDOWS\rundll32.exe
> > C:\WINDOWS\SYSTEM\amovie.ocx,RunDll /play /close " &
> > MySoundLocation, vbHide)

> > Example 2: (Me!SoundFile is an embeded WAV file on the form)
> >     Me!SoundFile.Class = "SoundRec"
> >     Me!SoundFile.Action = acOLECreateEmbed
> >     SoundFile.SourceDoc = MySoundLocation
> >     SoundFile.SourceItem = "Wave"
> >     SoundFile.Action = acOLEActivate

> > Here are 2 of the errors that I receive:
> > "The OLE server wasn't able to open the object"
> > or an error appears and the the sound repeats over the speakers and I
have
> > to reboot the computer.

> > Any suggestions would be a great help!

> > Jerry



Mon, 06 Oct 2003 19:01:34 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Playing sounds even if other applications are playing sounds

2. Moving from New Record to Existing Record in Code

3. Play sound without .wav..

4. Play sound without .wav..

5. How to play sound without killing responsiveness

6. playing sounds without using MCI

7. Application That Will Record and Play Sound (real-time)

8. Sound record & play

9. VB Control to play and record sounds

10. VB Control to play and record sounds

11. How to record and play sounds

12. Sample for play and record sound card ?

 

 
Powered by phpBB® Forum Software