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?
相关问题
- WCSession Failing to Activate
- Detecting swipes on all four directions on WatchKi
- Wat is the difference between static notification
- Apple watch and iPhone are not connected when the
- iOS Error: FBSOpenApplicationErrorDomain error 5.
相关文章
- How can I set the backgroundColor of a WKInterface
- How to avoid this error: “Took too long to show cu
- Change text color of WKInterfaceLabel using NSMuta
- Is it possible to trigger a haptic feedback withou
- Apple Watch Table - first 4 rows not appearing
- WatchOS Unit Testing
- NSXMLParserErrorMessage - Could not open data stre
- How to update Watch Complication only when the wat
You can access the Watch's microphone on watchOS 2.
1) Create a file URL at which to store the recorded output.
You may specify the extensions .wav, .mp4, and .m4a.
2) Call the method as follows:
You can choose preset in addition to the above
In Swift:
You can play the recorded file as follows:
You can check the detail specification here.
I think there are good news from the WWDC 2015 and the new watchOS 2 beta:
Unfortunately, at the moment there is noting about audio in the documentation.
I couldn't find a specific mention of it in the official documentation but on the Developer Forums word from the mods is that it isn't currently possible.
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:
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.
If you are looking for dictation, here are some early findings on the SDK: http://natashatherobot.com/watchkit-text-input-dictation-api/
Obviously, cannot be tested until the hardware is out :D