473,748 Members | 2,422 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Background Music and Button Sound

16 New Member
I want to have a background music to my simple app and a buton which plays another sound, but when I press the button the sound from it interrupts the background sound. I tried with SoundPlayer and the native PlaySound function but the results were the same. Any ideas how to have a background music and a button sound without using DirectSound? Can you provide me some snippets?
Jun 10 '09 #1
2 4411
tlhintoq
3,525 Recognized Expert Specialist
Have you tried putting the "button press" sound on a different thread?
Or a new instance of the sound player?
Jun 10 '09 #2
ventsislav
16 New Member
SoundPlayer supports only 1 instance and with threads the problem stands still. Any other ideas?
Jun 10 '09 #3

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

Similar topics

12
16138
by: Marian Aldenhövel | last post by:
Hi, I am trying to make pygame play music on windows. This simple program: import pygame,time pygame.init() print "Mixer settings", pygame.mixer.get_init() print "Mixer channels", pygame.mixer.get_num_channels() pygame.mixer.music.set_volume(1.0) pygame.mixer.music.load('file1.mp3)
3
4625
by: Gil | last post by:
I'm trying to write a page that allows me to change the background midi that's playing. I've been going crazy consulting Google Groups, and coming up with ingenious solutions, some of which kind of work in some situations. I'm quite prepared to implement a number of solutions simultaneously and browser-distinguish to select the right one, but it's hard even to find the criteria that decide what works in which browser. I'd be grateful...
4
9607
by: Peter | last post by:
I've embedded a midi file as background sound in my "index.html" which links to other pages on the site and I want the the same background sound to play on all pages "without interruption (and restarting)" when going to the other pages. Can anyone give me some insight as to how this can be done? Appreciate any help offered. TIA Peter
7
2510
by: paytam | last post by:
How can I design a simple sound player in C.I also don't know the structre of music files format.Please help me.
4
3885
by: Doug van Vianen | last post by:
Hi, I am using Visual Basic 6 to generate web pages that can be used by the members of our seniors' computer club to create e-cards that include their own pictures. I wish to include background music. The music plays okay until the viewer clicks to cause some JavaScript code to execute. When the JavaScript code runs it stops the music even though the coding is just used to resize pictures and divs on the page (viz, it is not supposed...
4
2521
by: Scott-ASC | last post by:
I'm looking for some code that will allow me to have a random wav file played every time someone refreshes my home page. I've found some that will allow 5 different wavs (and it wasn't scalable), but I've got 100+ wavs that I'd like to use so I need some code that can scale. Any help would be appreciated.
0
1096
by: paodzy | last post by:
how to import a sound that serve as a background music. please cite some example of codes.
5
1326
by: '2+ | last post by:
well maybe am over-advertising .. excuse me ... am new to python but my "algo-comping cs.sco with python" thang kinda got lauched after all so decided to move from java to python to do these thangs completly platform independently oh .. am just curious who are the guys over here composing weird music with python as my self-introduction...
2
3359
by: Mickey Flores | last post by:
I have just tried to attach a background sound with on/off button to my movie clip at frame 1 of the main Timeline. Flash Movie: the movie will keep on replaying until a viewer clicks a button. (frame 1 to 7) Problem: the background sound plays again on top of the ancient one. And as the movie starts again, one more piece will be played, and so on. I've tried to use different approach with action script but no luck, Please help.
0
8832
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9378
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9331
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8250
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6798
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6077
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3316
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
2
2791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.