objective-c - 检索用户铃声库

标签 objective-c ios xcode

我想知道是否有办法检索用户的铃声或声音。我对他们的音乐播放列表不感兴趣,但喜欢可以用于 uilocalnotifications 的 30 秒音频剪辑。有谁知道如何做到这一点?谢谢!

最佳答案

请参阅此答案。 how to get the system ringtones programmingly in ios?

如果您仍想触发音频通知,这 article应该让你开始。 您似乎可以为 soundName 属性分配一个文件名,或者为(我猜是)用户选择的通知声音传递 UILocalNotificationDefaultSoundName

- (void)scheduleNotificationWithItem:(ToDoItem *)item interval:(int)minutesBefore {
    UILocalNotification *localNotif = [[UILocalNotification alloc] init];
    localNotif.soundName = UILocalNotificationDefaultSoundName;
    ...
    [localNotif release];
}

关于objective-c - 检索用户铃声库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11462571/

相关文章:

ios - xcode: ios 动态框架在提交时显示 "Entitlements 0"

ios - 如何在两个类之间传递变量

ios - UIAlertController 无法满足约束

ios - 如何找到字典数组中 'name' 键以某个字母开头的第一个索引?

objective-c - 如何判断 CGImageRef 是否完全空白?

ios - UIView 图层动画后显示不正确

objective-c - 更新 NSArray 上的值

ios - 管理 View Controller 以维护状态

ios - 从 SKNode 中删除特定的 SKAction 列表

ios - AVCaptureStillImageOutput captureStillImageAsynchronouslyFromConnection :completionHandler inactive/invalid connection passed?