Mobile Zone is brought to you in partnership with:

Senthil Kumar is a Software Engineer who has around 3 years of experience in IT industry. He is currently working as a Software Engineer in Bangalore and works mainly on the Windows or Client Development technologies and has good working experience in C#/.NET, Delphi, Winforms and SQL Server. He is also a Microsoft Technology Certified Professional in ASP.NET. He Blogs at http://www.ginktage.com and http://www.windowsphonerocks.com. He enjoys learning as much as he can about all things related to technologies to get a well-rounded exposure of technologies that surround him. Senthil completed his Master of Computer Applications from Christ College (Autonomous), Bangalore in the year 2009 and is a MCA Rank Holder. He has passion for Microsoft technologies especially Windows Phone development. You can connect with him on Twitter at (http://twitter.com/isenthil) , on Facebook at (http://www.facebook.com/kumarbsenthil) and his blog (www.ginktage.com). Senthil is a DZone MVB and is not an employee of DZone and has posted 118 posts at DZone. You can read more from them at their website. View Full User Profile

Windows Phone and PhoneGap; The Beep Sound

06.04.2012
| 1881 views |
  • submit to reddit

Well , this is something simple which can be done in 1 line of code if you are using PhoneGap for Windows Phone .

If you are using Windows Phone SDK and developing App in Silverlight or XNA , you might end up using the SoundEffect class to load the sound from the stram and play it for a beep sound .

The PhoneGap provides the method navigator.notification.beep that plays the beep sound .

The methods navigator.notification.beep takes 1 parameter i.e the number of times the beep sound should be made

navigator.notification.beep(3) which makes 3 beep sound .

function Button1_onclick()
{
navigator.notification.beep(100);
}

How is this done in PhoneGap where in one needs to load the file in silverlight or XNA ?

Well , looks like a file to load the Beep sound is loaded internally in PhoneGp library to achieve this …

Published at DZone with permission of Senthil Kumar, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)