问题
Is it possible to obtain raw microphone data on the Windows Phone 7 to measure the ambient sound? If so, how can I do this?
回答1:
not sure if you are familiar with Dealing with micrphone in WP7 or not but you can check this blog post for a full detailed tutorial :
you initialize a buffer with the size of the data :
_buffer = new byte[_microphone.GetSampleSizeInBytes(_microphone.BufferDuration)];
and whenever the Microphone data is ready in this event handler get the data from the microphone add it to the Buffer then you can do anything using it :
private void MicrophoneBufferReady(object sender, EventArgs e)
{
_microphone.GetData(_buffer);
//Do something with the data
}
you'll need to include and everything is stated in the tutorial in Details
using Microsoft.Xna.Framework.Audio;
回答2:
All you need is here:
http://library.developer.nokia.com/Community/Wiki/How_to_access_and_manage_the_Microphone_raw_data_in_WP7
来源:https://stackoverflow.com/questions/8116577/getting-raw-microphone-data-on-the-windows-phone