473,569 Members | 2,790 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Playing multiple sounds

1 New Member
Please help, i've looked everywhere on the internet for the answer, but nothing works! here is my problem:

I have a Pong game, and would like to have a background .wav file playing.
I also have .wav files for the sound effects, so when i launch the game, it plays the background loop first, then when something happens it stops the background sound, then plays the effect sound. I want it to either not stop the background loop, or to stop it, play the effect, then continiue where it left off.

i used
My.Computer.Aud io.Play(My.Reso urces.BG_loop, AudioPlayMode.B ackground)

and

My.Computer.Aud io.Play(My.Reso urces.pongbeep_ score, AudioPlayMode.B ackground)

to play my sounds.

PS i would prefer if the the sound files were in the ressources, for that is how i did it there
May 1 '07 #1
1 2164
Dököll
2,364 Recognized Expert Top Contributor
My.Computer.Aud io.Play(My.Reso urces.BG_loop, AudioPlayMode.B ackground)

and

My.Computer.Aud io.Play(My.Reso urces.pongbeep_ score, AudioPlayMode.B ackground)

to play my sounds.

PS i would prefer if the the sound files were in the ressources, for that is how i did it there
Greetings and salutations, poo22!

Sounds like you needa select case, If statement/ perhpas a timer added to choose at which point yopu need the sound to pick up where it left off.

Hope this helps...In a bit!

Dököll
May 2 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
9276
by: Kiteman \(Canada\) | last post by:
Instead of a beep sound playing as an alarm or reminder I would like to be able to play a more interesting sound. On the web, I found and tried a sound routine that uses the SOUND.DRV but it does not work for me. Maybe it would be best to try to play a small mp3 or wav file instead - does VB 6.0 have built-in support for sounds like that?...
1
2835
by: Peter Schmitz | last post by:
Hi, I'm just trying to play a *.wav file, making use of the unmanaged function "sndPlaySoundA" in winmm.dll, but I still got one question: How can I avoid, that the sound file itself has to be seperate file in a specific directory, but instead 'integrate' it in my application? Thanks peter
0
1151
by: Adrian | last post by:
Is there a way in C# to play various sounds (WAV files) simultaneously? I also need to jump to the middle of the WAV files and start playing from there, not just from the beginning. Thanks.
32
14783
by: tshad | last post by:
Can you do a search for more that one string in another string? Something like: someString.IndexOf("something1","something2","something3",0) or would you have to do something like: if ((someString.IndexOf("something1",0) >= 0) || ((someString.IndexOf("something2",0) >= 0) ||
8
2518
by: shlomi | last post by:
Hello, It's been long time that I'm investigating on how to play Avi file from memory, with no success. What I'm trying to do is to get a scrambled Avi file to memory, fix same data and then playing it as Avi file. An alternative way is encapsulate the binary data into the exe file with a recourse file and than playing it.
1
1492
by: Tom W | last post by:
hi I've found some code for playing sounds and it kinda works. This is what I have \\\\\Public Class SoundClas Declare Auto Function PlaySound Lib "winmm.dll" (ByVal name As String, ByVal hmod As Integer, ByVal flags As Integer) As Intege ' name specifies the sound file when the SND_FILENAME flag is se ' hmod specifies an executable file...
0
1125
by: A. Gaubatz | last post by:
I am not a very advanced programmer with VB, but I need to be able to play at least two sounds at once, which my current code: SoundPlayer.FileName = "..." SoundPlayer.Play() will not do. Is there any simple way to do this? *** Sent via Developersdex http://www.developersdex.com ***
1
3738
by: Terry Olsen | last post by:
Using the following routine to play embedded wav files: Private Sub PlaySound(ByVal Sound As Int32) Select Case Sound Case 1 : My.Computer.Audio.Play(My.Resources.Sounds.GoOnline, AudioPlayMode.Background) Case 2 : My.Computer.Audio.Play(My.Resources.Sounds.DoorOpen, AudioPlayMode.Background) Case 3 :...
1
1345
by: sandeepk84 | last post by:
Hi all... I wanted to add a functionality to my software for recording and playing sounds. Does anyone know how it can be done in java? How Sound API can be used? Even if it supports only some common sound formats, it's ok. can anyone help me? Thanks and Regards, Sand...
0
7694
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7609
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8118
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7964
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6278
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3636
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2107
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1208
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
936
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.