|
|
Stop my sound
I'm using the following code to play a sound or music in a game I made for my
class, however I don't always want to wait for the sound or song to finish.
How can I stop the song/sound? Need code to stop a sound/song from
completing. Or would I use some type of Exit Sub procedure? If so, don't
know how to code.
Dim RandomSong As Integer
Sub PlayRandomSong()
RandomSong = Int((4 - 1 + 1) * Rnd + 1)
If RandomSong = 4 Then
CenterField
ElseIf RandomSong = 3 Then
StadiumCheer
ElseIf RandomSong = 2 Then
TakeMeToBallGame
ElseIf RandomSong = 1 Then
Booing
End If
End Sub
Sub CenterField()
Call sndPlaySound32 _
("C:\centerfield", 0)
End Sub
Sub TakeMeToBallGame()
Call sndPlaySound32 _
("C:\outtoballgame", 0)
End Sub
Sub StadiumCheer()
Call sndPlaySound32 _
("C:\stadiumroar", 0)
End Sub
Sub Booing()
Call sndPlaySound32 _
("C:\booing", 0)
End Sub
--
Mike Mast
Special Education Preschool Teacher
|
|
0
|
|
|
|
Reply
|
Utf
|
4/6/2010 12:46:03 AM |
|
You shouldn't need to do it in code. You can set any button to play the
sound "Stop all sounds," I believe. This should stop whatever is
playing. Plus, if that same button needs to run VBA or do a hyperlink,
it should be able to do that, too.
--David
On 4/5/10 8:46 PM, Preschool Mike wrote:
> I'm using the following code to play a sound or music in a game I made for my
> class, however I don't always want to wait for the sound or song to finish.
> How can I stop the song/sound? Need code to stop a sound/song from
> completing. Or would I use some type of Exit Sub procedure? If so, don't
> know how to code.
>
> Dim RandomSong As Integer
>
> Sub PlayRandomSong()
> RandomSong = Int((4 - 1 + 1) * Rnd + 1)
> If RandomSong = 4 Then
> CenterField
> ElseIf RandomSong = 3 Then
> StadiumCheer
> ElseIf RandomSong = 2 Then
> TakeMeToBallGame
> ElseIf RandomSong = 1 Then
> Booing
> End If
> End Sub
>
> Sub CenterField()
> Call sndPlaySound32 _
> ("C:\centerfield", 0)
> End Sub
>
> Sub TakeMeToBallGame()
> Call sndPlaySound32 _
> ("C:\outtoballgame", 0)
> End Sub
>
> Sub StadiumCheer()
> Call sndPlaySound32 _
> ("C:\stadiumroar", 0)
> End Sub
>
> Sub Booing()
> Call sndPlaySound32 _
> ("C:\booing", 0)
> End Sub
--
David M. Marcovitz
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
Microsoft PowerPoint MVP
Associate Professor, Loyola University Maryland
|
|
0
|
|
|
|
Reply
|
David
|
4/6/2010 1:13:12 AM
|
|
|
1 Replies
398 Views
(page loaded in 0.08 seconds)
Similiar Articles: Stop my sound - microsoft.public.powerpointI'm using the following code to play a sound or music in a game I made for my class, however I don't always want to wait for the sound or song to fi... Videos stop playing in Presenter View - microsoft.public ...When I use Presenter View in PowerPoint 2007, my videos start okay, then a few seconds in, the audio continues but the video screen freezes. They pl... stop sound when on video slide - microsoft.public.powerpoint ...i create one power point with full of internal hyperlink which go around all my slide. i add a music (mp3) to be continuously play all the time. No... music files start to play but stop playing after a few seconds ...I have Vista operating system. Windows Media PLayer version is 11.0.6002.18005. My problem is I start windows media player audio files the music p... Disable Error Sound - microsoft.public.access.formscoding ...Outlook 2007 and Windows 7 - No new mail sound and notifications ..... the icon and sound ... to enable or disable the mail notification sound that Outlook 2007 ... and ... Effect Setting to Stop Sound File - does not work for emailed file ...In PP 2007, I have embedded a .wav file into the first slide and set the Effects within Custom Animation so that the sound will stop playing with a ... music stops before end of song in middle of timed slide ...Stop my sound - microsoft.public.powerpoint music stops before end of song in middle of timed slide ... You may have a sound card that can not handle multiple sound ... Multiple sounds on a slide - microsoft.public.powerpoint ...Stop my sound - microsoft.public.powerpoint music stops before end of song in middle of timed slide ... You may have a sound card that can not handle multiple sound ... Help - Service Stopping - microsoft.public.windows.server.sbs ...Some Windows services like computer browser, server & windows audio etc are stops ... Start/stop Services for Power users, help, FAQ, forums, question ... Start/stop ... How to stop a service and wait until service stopped? - microsoft ...Stop my sound - microsoft.public.powerpoint... want to wait for the sound or song to finish. How can I stop ... music stops before end ... etc are stops ... My.Computer.Audio.Stop Method - Microsoft Corporation: Software ...Stops a sound playing in the background. ... The My.Computer.Audio.Stop method stops a sound playing in the background that was started by the My.Computer.Audio.Play ... Why would my sound stop working? - Computer Tech Support Forum ...Basically I walked away from my computer and came back to no sound. It's my speakers and headphones. It's just dead. No fuzziness or anything. I've tried several ... How to Stop All Audio on a Computer | eHow.comWhether you are using the provided motherboard audio output or a third-party sound card, there is an easy way in which you can turn off all of the audio devices on ... How to Stop Programs From Using Your Sound Card | eHow.comIt can be extremely jarring when a sound plays from the computer unexpectedly--such as an embedded sound on a website--while you are listening to music. In the past ... Audio.Stop Method (Microsoft.VisualBasic.Devices)Stops a sound playing in the background. ... The My.Computer.Audio.Stop method stops a sound playing in the background that was started by the My.Computer.Audio.Play ... 7/26/2012 9:06:33 AM
|
|
|
|
|
|
|
|
|