媒体概述Media overview

Microsoft Graph 中的云通信 Api 为您的应用和服务如何通过各种通信相关功能(如呼叫和联机会议)与用户进行交互,从而添加了一个新的维度。The cloud communications APIs in Microsoft Graph add a new dimension to how your apps and services interact with users through various communications related features, such as calling and online meetings. 您可以启用您的 bot 以发送和接收与音频和视频相关的内容。You can enable your bots to send and receive audio- and video-related content. 通过使用媒体,你可以在你的 bot 和用户之间创建更具交互性的体验。By making use of media, you can create a more interactive experience between your bots and users.

本文将帮助您根据自己的需要,发现哪种媒体承载选项适合您。This article will help you discover which media hosting option is right for you based on your needs.

服务承载的媒体(远程承载)Service-hosted media (remote hosting)

如果您希望您的 bot 在客户拨打您的公司号码时播放自定义提示,或者要检测电话音、录制短语音剪辑或执行各种交互式语音响应(IVR)方案,请考虑使用服务托管的媒体 apiIf you want your bot to play a custom prompt when a customer dials your business's number, or to detect phone tones, record short voice clips, or perform any of the various Interactive Voice Response (IVR) scenarios, consider using the service-hosted media APIs.

如果你的媒体需求更简单,请先浏览此选项If your media needs are simpler, explore this option first. 由于远程卸载了重型媒体处理,因此这是一个较轻重量的解决方案,可让你以更灵活的方式构建你的 bot。Because the heavy media processing is offloaded remotely, this is a lighter weight solution that allows you to build your bot in a more flexible way.

有关演示如何创建使用服务托管媒体的 bot 的示例,请参阅远程媒体呼叫机器人示例For an example that shows you how to create a bot that uses service-hosted media, see the Remote media calling bot samples.

远程承载关系图

应用程序承载的媒体(本地托管)Application-hosted media (local hosting)

如果您希望您的 bot 访问客户的音频和视频流,以用于通过自然语言处理服务录制、转录、翻译或看法分析,请考虑在本地托管媒体。If you want your bot to access a live stream of your customers' audio and video to use for recording, transcribing, translating, or sentiment analysis through a natural language processing service, consider hosting your media locally.

注意: 您不能录制或以其他方式保留来自您的应用程序访问的呼叫或会议的媒体内容或从该媒体内容派生的数据。Note: You may not record or otherwise persist media content from calls or meetings that your application accesses, or data derived from that media content. 请确保您符合有关通信的数据保护和机密性的法律和法规。Make sure you are compliant with the laws and regulations of your area regarding data protection and confidentiality of communications. 有关详细信息,请参阅使用条款并咨询法律顾问。Please see the Terms of Use and consult with your legal counsel for more information.

如果您希望更好地控制媒体,请选择此选项If you'd like more control over your media, choose this option. 你将能够直接访问媒体流,并且可以使用基于视频的屏幕共享。You'll have direct access to media streams and will be able to make use of video-based screen sharing. 你将能够生成启用了语音的更复杂的 IVR 方案。You'll be able to build more sophisticated IVR scenarios that are speech enabled. 这是一个较重的解决方案,为你提供了对媒体编程方式的最大灵活性。This is a heavier weight solution that gives you the most flexibility in how you want to program your media.

另请参阅应用程序托管媒体 bot 的要求和注意事项See also the requirements and considerations for application-hosted media bots.

有关演示如何创建使用应用程序承载的媒体的 bot 的示例,请参阅本地媒体示例For an example that shows you how to create a bot that uses application-hosted media, see the local media samples.

本地承载关系图

另请参阅See also