Windows Phone: Playing Sound Effects

Monday, September 3, 2012

I wanted to create a simple timer application for Windows Phone. The timer would count backwards from a user configured value and when it reached zero, it would play some sound effect to indicate expiration. Sounds simple enough…This is how the application looks like:The problem turned out to be playing that sound effect. I had a WAV file I wanted to play. Silverlight has a MediaElement object that is capable of playing video and/or audio, so it seemed to be a good candidate for the job. MediaElement is an element, so must be placed somewhere in the visual tree....
no comments

Windows 8 & Phone 8 UG August Meeting

Wednesday, August 29, 2012

Last evening we had a User Group meeting in Microsoft Offices in Ra’anana, with a lot of activity and fun. Thank you all for participating!In the first part, we discussed the Windows 8 Store from various angles, end user and developer.In the second part, we discussed Windows Phone 7.x and the upcoming 8, along with other sporadic topics - C++, WinRT, DirectX, COM, XNA, XAML… it was fun! And don’t forget the giveaways!Just as a gentle reminder, out next meeting is on September 13th, where we’ll have an interesting session on “Metro” User Experience and User Interface from an...

WPF Tip: Displaying Images in different Pixel formats

Monday, January 30, 2012

If we want to show an image in WPF, we typically use an Image element and connect its Source property to some image resource within our project: <Image Source="Penguins.jpg" /> The Source property is not a string, it’s an ImageSource – an abstract type with several concrete implementations that provide a “real” image source. The above markup works thanks to the help of a type converter, that makes the source a BitmapImage – one of the simplest sources, that presents the image as is. What if we wanted to show the...

First Meeting of the Windows Devices Israel User Group

Tuesday, January 17, 2012

Yesterday evening we’ve held the first meeting of the new Windows Devices user group at Microsoft offices in Ra’anana. This first meeting was dedicated to Windows Phone 7. Elad and I had a lot of fun and we hope you guys had fun as well and learned something along the way. What we’ve done is talk about the Windows Phone platform in general, its capabilities, the tools used to write applications and games, while showing a few demos. We tried to answer as many general questions as we could, and those questions are definitely a basis for future meetings....

My Sessions at the MobiWeb Conference

Friday, December 16, 2011

The MobiWeb Conference is scheduled for the 15-17 of January in the Daniel Hotel in Hertzliya (Israel). The sessions in the conference are “one day seminars”, each seminar covering some topic related to web development, mobile development, or both. I’ll be presenting two seminars at the conference. The fist, “Building Windows Phone 7 Apps with Silverlight” (on the 16th) will cover the development for the (relatively new) Windows Phone platform using Silverlight (and maybe some XNA if we have time). Anyone looking into developing applications for this exciting and capable platform should get a good head start by...
no comments

Windows Phone: Combining Silverlight & XNA in a Single Page

Wednesday, October 26, 2011

There are two very distinct ways to program on Windows Phone 7.x: Silverlight & XNA. Silverlight is about UI, retained graphics and is event driven. XNA is about immediate mode graphics, based on a timer and polling; Very different models indeed. Each has its strengths and weaknesses. One of the new features in WP7.1 (“mango”) is the ability to combine the two to get the best of both worlds. Here’s a typical scenario where this need may come up: suppose you’re developing an XNA game (2D or 3D). In a typical game you need to allow some configuration,...

Porting an XNA game from Windows to Windows Phone (Part 3)

Thursday, August 25, 2011

In the previous post, we got a working game that uses touch gestures to move the player’s ship. This may be adequate, but perhaps we can try a different approach: using the accelerometer. Every Windows Phone device must have an accelerometer, which indicates its relative orientation in space. Tilting the phone from side to side may be more intuitive (and perhaps exciting) than simply dragging horizontally. Let’s try that. The first thing we need to do is add a reference to the Microsoft.Devices.Sensors assembly, and add a conditional using statement to the Microsoft.Devices.Sensors namespace. This exposes the...

Porting an XNA game from Windows to Windows Phone (Part 2)

Sunday, August 14, 2011

In the first part we got our introduction screen up and running, with the starfield scrolling by. However, we couldn’t actually start playing because the game was waiting for a key press… which is nowhere to be found on a Windows Phone device. We simply need a little touch. Adding Touch Support Touch is something the XNA version of Windows and XBOX 360 have no notion of. This is specific for Windows Phone. Touch input information is available as “raw” data (touch points, with positions, etc.) and with a higher level abstraction called gestures. We’ll start with...
one comment

Porting an XNA game from Windows to Windows Phone (Part 1)

Monday, August 8, 2011

XNA is one of the two APIs that’s supported on Windows Phone 7 (the other being Silverlight), so a natural thing to do is to port an already existing XNA game (running on Windows or XBOX 360) to the new Windows Phone 7 platform. I wanted to see how easy (or maybe not so easy) it would be to do the actual porting. My starting point is a relatively simple 2D game, the one developed throughout the XNA 2D tutorial I did a some months back. We’ll start with the final game project (discussed in the last part...
no comments

XNA 2D Game Tutorial (Part 14–Last)

Friday, December 31, 2010

Previous posts in this series: Part 1: Getting started Part 2: Drawing something Part 3: Input handling Part 4: Game Components Part 5: Animation and Sprites Part 6: Handling Projectiles Part 7: Sound Effects Part 8: Setting Up Data Part 9: Creating Aliens Part 10: Collision Detection Part 11: More Collisions ...
tags: , , ,