I have sound data in a byte array.I got this by reading a .wav file using BinaryReader. i want to play it in WP7. is there a way of doing that using xna?
basically its the output of merging n .wav files. on a pc i could save the file and read it back as a stream(using 'FileStream'). i could then play the sound using 'System.Media.SoundPlayer' which takes stream as an argument.
can the problem be solved on similar grounds in wp7?
thanks in advance
play byte array of sound data in wp7 using xna
Page 1 of 12 Replies - 3597 Views - Last Post: 09 July 2011 - 02:52 PM
Replies To: play byte array of sound data in wp7 using xna
#2
Re: play byte array of sound data in wp7 using xna
Posted 05 July 2011 - 08:04 AM
You can try using the SoundEffect class that accepts a stream.
You could also look into using the PhoneyTools SoundEffectPlayer class.
You could also look into using the PhoneyTools SoundEffectPlayer class.
Quote
This class is used to play SoundEffect objects using the XNA integration. The player must live long enough for the sound effect to play so it is common to have it scoped outside a method. For example:
#3
Re: play byte array of sound data in wp7 using xna
Posted 09 July 2011 - 02:52 PM
SoundEffect should indeed be the foundation in your case. You can easily create the stream from a byte array by invoking .Write for the stream-based instance that you have. If you look at existing Microphone usage samples, you can see how easy it is possible to replay recorded content.
This post has been edited by Core: 09 July 2011 - 02:55 PM
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote




|