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

有没有办法从苹果手表的扬声器播放声音?我一直无法在线找到任何文件.

解决方法

现在可以通过使用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 16 更新版本时,我们听到了困扰 Apple...
欧版/美版 特别说一下,美版选错了 可能会永久丧失4G,不过只...
一般在接外包的时候, 通常第三方需要安装你的app进行测...
前言为了让更多的人永远记住12月13日,各大厂都在这一天将应...