Windows Phone的 - 音频端点设备 [英] Windows Phone - Audio Endpoint Device

查看:378
本文介绍了Windows Phone的 - 音频端点设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我似乎无法找到此的任何地方。

I can't seem to find this anywhere.

我想建立一个插入Windows Phone的耳机插孔音频端点设备。

I want to build an Audio Endpoint device that plugs into the Windows Phone Headphone Jack.

我知道我需要开始什么手机能够接收和检测。

I know I need to start with what the phone is capable of receiving and detecting.

最后,我想存在库已经使用,但是我不知道写我自己的心痛。

Ultimately I would like to use already in existence libraries however I have no heartache about writing my own.

我的问题是我找不到人如何访问音频输入手机上的内置麦克风以外的任何实例。

My problem is I can't find any examples of how people access the Audio input on the phone outside of the built in microphone.

是否有这样的图书馆吗?

Is there a library for this?

推荐答案

您可以检测当耳机插入使用的Windows Phone 8的VOIP功能。

You can detect when a headset is plugged in using the VOIP capabilities in Windows Phone 8.

首先在WMAppManifest.xml文件,则需要启用ID_CAP_VOIP和ID_CAP_AUDIOROUTING

First in the WMAppManifest.xml file, you need to enable ID_CAP_VOIP and ID_CAP_AUDIOROUTING

然后在应用程序,你需要捕获事件

Then in the App, you need to capture the event

AudioRoutingManager.GetDefault().AudioEndpointChanged += AudioEndpointChanged;

public void AudioEndpointChanged(AudioRoutingManager sender, object args) 
{
  var AudioEndPoint = sender.GetAudioEndpoint();
  switch (AudioEndPoint)
  {
     case AudioRoutingEndpoint.WiredHeadset:
          MessageBox.Show("Headset connected");
          break;
  }
}

这将从这份名单列举(不能自定义端点)

This will enumerate from this list (no custom endpoints allowed)

http://msdn.microsoft.com/en-us/library/windowsphone/develop/windows.phone.media.devices.audioroutingendpoint(v = VS。 105)的.aspx

很抱歉,但我只能回答你有关检测设备问题的第一部分,我不熟悉如何在硬件设备接口与耳机插孔回答其余部分。

Sorry, but I can only answer the first part of your question about detecting the device, I'm not familiar with how the hardware device interfaces with the headphone jack to answer the rest.

这篇关于Windows Phone的 - 音频端点设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆