For this sample, the first thing I did was create some ring tones, now I did this in a very simplistic manor, I got a copy of Hammerhead and just used a few samples off that, 4 ring tones.
Now in XNA, we normally just throw our assets into the content pipeline and it sorts it all out for us, but due to the way MS have implemented ringtones we can’t just do that in XNA, we have to have them in the content pipeline as wav’s and as they are intended to be in the game project it’s self as mp3’s. This is all due to the lack of control XNA has compared with the Silverlight implementation over the MediaPlayer, read into that what you will…
[EDIT]Just found this post, which will get around this :S [/EDIT]
So, with my 4 new super duper ring tones my project(s) look like this:
Here is a quick shot of the code in my Update method
I am not going to go over the code that renders the ringtone options, just show you the method used to play and to save the ringtones to the device.
Play a Ringtone
Save a Ringtone
The srt_Completed call back method then informs the user if it’s all gone well.
So that’s about it, my way of saving/playing ringtones on WP7 in XNA. As ever, comments are more than welcome…
Source code can be found here [Not yet uloaded]