简体   繁体   English

如何在iOS静态库中添加音频文件

[英]How to add audio files in iOS static library

I am building a static library. 我正在建立一个静态库。 Now, I want to play an audio file when a push is received, like a ringtone. 现在,我想在收到推送(例如铃声)时播放音频文件。 Tone should not be system notification tone. 提示音不应是系统通知提示音。 How do I do this? 我该怎么做呢? From app, I am able to do this but in static library, how do I include the file. 从应用程序中,我可以执行此操作,但是在静态库中,如何包含文件。 I don't want to let my client know which is being played. 我不想让我的客户知道正在玩哪个游戏。

Read this article and see if this helps. 阅读本文,看看是否有帮助。 Just bear in mind that Static Libraries have some bugs. 请记住,静态库有一些错误。

http://landonf.bikemonkey.org/code/ios/Radar_15800975_iOS_Frameworks.20140112.html http://landonf.bikemonkey.org/code/ios/Radar_15800975_iOS_Frameworks.20140112.html

Not possible to add a audio file in static library. 无法在静态库中添加音频文件。 You need to create a resource file externally where you can add the audio file and you need to add this in the project along with your library and then you need to communicate with it. 您需要在外部创建一个资源文件,您可以在其中添加音频文件,并且需要将此资源文件与库一起添加到项目中,然后需要与它进行通信。 i had same situation for image i used base64 string of that image and used, if you can change the audio file to base64 it is better 我对图像有相同的情况我使用了该图像的base64字符串并使用了,如果您可以将音频文件更改为base64,那会更好

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

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