大佬教程收集整理的这篇文章主要介绍了为什么AudioKit的AKMicrophoneTracker不能在物理iOS设备上运行?,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
这是一个粗略的例子:
class AppDelegate: UIResponder,UIApplicationDelegate { let tracker = AKMicrophoneTracker() func application(_ application: UIApplication,didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // start the tracker and show frequency information tracker.start() Timer.scheduledTimer(withTimeInterval: 0.1,repeats: true,block: { _ in print(tracker.frequency) print(tracker.amplitudE) }) } }
我重置了物理设备的隐私权限,iOS正确地提示我允许麦克风访问.即使我允许麦克风访问,它仍然无法正常工作.
如何让AKMicrophoneTracker实际读取这些值?
我正在使用AudioKit 4.0.3.使用时,它按预期工作:
>我的Mac上的AudioKit游乐场
>运行iOS 11.1的模拟器iPhone 7 Plus
使用时不起作用:
>运行iOS 11.1.1的物理iPhone 7 Plus(也适用于iOS 11.1)
我最初发布的是a bug on AudioKit’s GitHub issue tracker.但是,Aure(项目维护者)鼓励我在这里发帖.
在AppDelegate中:
import UIKit import AudioKit @UIApplicationMain class AppDelegate: UIResponder,UIApplicationDelegate { var window: UIWindow? let tracker = AKMicrophoneTracker() func application(_ application: UIApplication,didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. // start the tracker and show frequency information tracker.start() Timer.scheduledTimer(withTimeInterval: 0.5,block: { _ in print(self.tracker.frequency) print(self.tracker.amplitudE) }) return true } ...
info.plist中
... <key>NSMicrophoneUsageDescription</key> <String>WE need your microfone to contact the aliens</String> ...
以上是大佬教程为你收集整理的为什么AudioKit的AKMicrophoneTracker不能在物理iOS设备上运行?全部内容,希望文章能够帮你解决为什么AudioKit的AKMicrophoneTracker不能在物理iOS设备上运行?所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。