Getting raw microphone data on the Windows Phone?

◇◆丶佛笑我妖孽 提交于 2019-12-24 05:54:21

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!