Access Apple Watch's microphone

后端 未结 6 1866
栀梦
栀梦 2020-12-05 11:55

Now that more and more documentation on the Apple Watch is surfacing has anybody found a way to access and use the device\'s microphone?

6条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-05 12:19

    Yes, it is introduced in Watch OS 2.

    But as Apple mentioned, this part of the API is in preview, and it did changed a lot. As for Watch OS 2 beta 5, the according interface(in Swift) changed to:

    @available(watchOS 2.0, *)

    public func presentAudioRecorderControllerWithOutputURL(URL: NSURL, preset: WKAudioRecorderPreset, options: [NSObject : AnyObject]?, completion: (Bool, NSError?) -> Void)

    So please always refer to the SDK document you are using, if you want to try this new feature.

    By the way, this sample project would be a good start:

    https://github.com/shu223/watchOS-2-Sampler

    Still, some of the API used in sample is already changed, like this recording one.

提交回复
热议问题