简体   繁体   English

如何以编程方式在iphone中将音频文件设置为铃声

[英]How to set audio file as ringtone in iphone programmatically

I have created an application.我创建了一个应用程序。 In that, I have to list of audio files and "Set as ringtone" option there.在那,我必须列出音频文件和“设置为铃声”选项。 I don't know how to set audio file as ringtone.我不知道如何将音频文件设置为铃声。

It is not possible in iOS.There is no API for setting ringtone.在 iOS 中是不可能的。没有用于设置铃声的 API。 Apple does this for security and safety reasons But u can make ur audio as ringtone through itunes Apple出于安全和安全原因这样做但是您可以通过iTunes将您的音频设置为铃声

Enable "itunes file sharing" in info plist在 info plist 中启用“iTunes 文件共享”

This will help in that case How to add a ringtone from an application to ringtones of iphone?这将有助于在这种情况下如何将应用程序中的铃声添加到 iPhone 的铃声中?

You cannot.你不能。 Apple doesn't release an API to export/write ringtones to the operating system. Apple 不会发布 API 来将铃声导出/写入操作系统。 But u can make ur audio as ringtone through itunes但是你可以通过itunes把你的音频做成铃声

Use iTunes file sharing in your app and copy the ringtone file to the app's documents directory.在您的应用程序中使用 iTunes 文件共享并将铃声文件复制到应用程序的文档目录。

Set "Application supports iTunes file sharing" to YES in your info.plist在 info.plist 中将“应用程序支持 iTunes 文件共享”设置为 YES

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM