Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Keypad beeping

Posted on 2011-02-15
10
Medium Priority
?
438 Views
Last Modified: 2013-12-17
Hi,

During download file, I'd like the keypad beeping by writing C#
program. But I don't know how, could you give me a hand?
Thanks,
JT
0
Comment
Question by:jtran007
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 9

Expert Comment

by:s_chilkury
ID: 34903720
Playing Beep :

public void playBeep()
{
    SystemSounds.Exclamation.Play();
}

Playing custom sound:

private void playCustomSound()
{
    SoundPlayer simpleSound = new SoundPlayer(@"c:\Windows\Media\chimes.wav");
    simpleSound.Play();
}
0
 
LVL 30

Expert Comment

by:anarki_jimbel
ID: 34903756
You may need to add name spaces like System.Media.

You can utilize the namespace and its SystemSound and SystemSounds classes (http://msdn.microsoft.com/en-us/library/system.media.systemsound.aspx)

The SystemSounds class contains five static properties that you can use to retrieve instances of the SystemSound class. This class in turn contains the Play() method, which you can use to play the wave file associated with the sound in Windows Control Panel. Note that the user can also disable all sounds altogether, which would mean that no sound can be heard through the computer speakers.

To play for example the classical beep sound, you could use the following code:

System.Media.SystemSounds.Beep.Play();
Similarly, you could play the “Question” sound with this code:

System.Media.SystemSounds.Question.Play();
The System.Media namespace is defined in System.dll, so there are no new DLLs you would need to add to your project’s references to use the above code.
0
 
LVL 30

Expert Comment

by:anarki_jimbel
ID: 34903786
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:jtran007
ID: 34903875
Hi,

Thanks, but how can I play it continuously until my file download is completed.

Regards,
JT
0
 
LVL 11

Assisted Solution

by:SAMIR BHOGAYTA
SAMIR BHOGAYTA earned 400 total points
ID: 34904534
Hi, use this code

//First add reference 'Microsoft.VisualBasic.DLL' to the project.
//then include
using Microsoft.VisualBasic.Devices;
//Now

Audio myAudio = new Audio();

myAudio.Play(@"d:\abc.wav");
0
 
LVL 75

Assisted Solution

by:käµfm³d 👽
käµfm³d   👽 earned 400 total points
ID: 34908679
>>  Thanks, but how can I play it continuously until my file download is completed.

You're going to have to spawn a separate thread. You might want to take a look at BackgroundWorker (http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx) or ThreadPool (http://msdn.microsoft.com/en-us/library/system.threading.threadpool.aspx).
0
 
LVL 30

Assisted Solution

by:anarki_jimbel
anarki_jimbel earned 200 total points
ID: 34913329
I'd use wav player (see reference above), use PlayLooping mode, detect when dowloading completes (it depends, I don't know how you download - just handle events, I believe), then call player.stop:

http://msdn.microsoft.com/en-us/library/system.media.soundplayer.aspx

0
 

Accepted Solution

by:
jtran007 earned 0 total points
ID: 34914519
Hi ,

Since I have a background thread handling download file, and I prefer the playing sound thread
not interferering with the background process. So which approach is the best way.

Thanks for your input.
JT
0
 

Author Comment

by:jtran007
ID: 34940290
Hi,

Sorry I still don't know how to stop the sound even at the end of uploading file, I stop the
background task where I play sound in the loop. But the sound keeps playing. Please help.

Thanks,
JT
0
 

Author Closing Comment

by:jtran007
ID: 34968331
Thanks,
JT
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question