ios - Openears 请求使用麦克风的许可

标签 ios objective-c permissions microphone openears

我制作了一个应用程序,它使用 Openears 框架来读出一些文本。但我没有使用任何 Openears 的 语音识别/语音合成功能,只使用了语音对话功能。我的应用程序被苹果拒绝,告诉我该应用程序要求获得使用麦克风的许可,而该应用程序没有任何此类功能。以下是苹果的拒绝信息:

During review we were prompted to provide consent to use the microphone, however, we were not able to find any features or functionality that use the microphone for audio recording.

The microphone consent request is generated by the use of either AVAudioSessionCategoryRecord or AVAudioSessionCategoryPlayAndRecord audio categories. 

If you do not intend to record audio with your application, it would be appropriate to choose the AVAudioSession session category that fits your application's needs or modify your app to include audio-recording features.

For more information, please refer to the Security section of the iOS SDK Release Notes for iOS 7 GM Seed.

我已在应用程序中搜索消息中提到的 AVAudioSessionCategoryRecordAVAudioSessionCategoryPlayAndRecord 音频类别,但找不到任何内容。如何禁用麦克风使用权限提示?

最佳答案

您的应用程序被拒绝,因为您不需要麦克风功能,默认情况下 openears 接口(interface)使用麦克风功能,因此需要用户权限。这些用户权限不可忽略,因为 Apple 为用户增加了安全功能,以便他们可以更好地控制他们希望应用程序能够执行的操作。如果您必须使用 OpenEars 音频管理功能进行语音识别,请参阅更新 1,否则继续使用 iOS 7 上的 Apples Siri 语音合成器的不同解决方案。

在您的情况下,如果您只想读出一些文本,那么您可以使用 iOS7 语音合成器,它与用于创建 Siri 声音的合成器相同。

它的设置非常简单,我目前正在将它用于我的一个项目以通过语音与用户交互。这是有关如何进行所有设置的快速教程:

Speech synthesizer tutorial

更新 1

在 @halle 的评论之后,我决定为那些必须使用 OpenEars 框架的人更新帖子,他们将仅使用 FliteController 文本转语音功能,而不使用任何类型的 OpenEars 语音识别。

您可以设置 FliteController 属性 noAudioSessionOverridesTRUE这样您就可以确保 OpenEars 不会与音频录制流交互,这将阻止弹出麦克风权限警报。

[self.fliteController setNoAudioSessionOverrides:TRUE]

<罢工>

更新 2 根据@Halle 的评论,您不再需要执行更新 1:

Just an update that starting with today's update 1.65, FliteController won't ever make audio session calls on its own, so there is no further rejection danger here and it isn't necessary to set noAudioSessionOverrides.

关于ios - Openears 请求使用麦克风的许可,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21156046/

相关文章:

linux - 无法将文件保存到/var/www/html——即使我在 www-data 组中

ios - MKAnnotationView 的 subview 上的 UITapGestureRecognizer 不起作用

css - 具有 02775 权限的 typo3 临时目录 block css 文件

android - Flutter 使用 NetworkImage 作为背景

ios - XCUIApplication 仅适用于 iOS 9.0 或更新版本,swift3

objective-c - 带有 UIImage 的 UIBarButtonItem 始终着色 iOS 7

ios - 自定义框架总是包含在嵌入式中?

c# - Process.Start 用户名 'Everyone' ?

ios - googledrivesdk和文件夹的处理

javascript - 单击使用 react native 时如何更改图像和文本颜色?