ios – 从Apple Watch扬声器播放声音

ios – 从Apple Watch扬声器播放声音,第1张

概述有没有办法从苹果手表的扬声器播放声音?我一直无法在线找到任何文件. 现在可以通过使用WKAudioFilePlayer或WKInterfaceMovie的watchOS 2来实现. NSURL *assetURL = [[NSBundle mainBundle] URLForResource:@"file" withExtension:@"wav"]; WKAudioFilePlayer示例: W 有没有办法从苹果手表的扬声器播放声音?我一直无法在线找到任何文件.解决方法 现在可以通过使用WKAudiofilePlayer或WKInterfaceMovIE的watchOS 2来实现.
NSURL *assetURL = [[NSBundle mainBundle] URLForResource:@"file" withExtension:@"wav"];

WKAudiofilePlayer示例:

WKAudiofileAsset *asset = [WKAudiofileAsset assetWithURL:assetURL];WKAudiofilePlayerItem *playerItem = [WKAudiofilePlayerItem playerItemWithAsset:asset];WKAudiofilePlayer *audiofilePlayer = [WKAudiofilePlayer playerWithPlayerItem:playerItem];[audiofilePlayer play];

WKInterfaceMovIE示例:

[self presentMediaPlayerControllerWithURL:assetURL options:nil completion:nil];
总结

以上是内存溢出为你收集整理的ios – 从Apple Watch扬声器播放声音全部内容,希望文章能够帮你解决ios – 从Apple Watch扬声器播放声音所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1110989.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-29
下一篇 2022-05-29

发表评论

登录后才能评论

评论列表(0条)

保存