首页 > 解决方案 > 如何在bootanimation中添加声音,我想在android启动时播放一些声音效果

问题描述

我在自定义 aosp 构建中创建了带有 PNG 文件的自定义 bootanimation.zip 文件,工作正常。所以现在我想为设备启动时间添加开机声音。这意味着当开机动画同时出现在屏幕上时需要播放开机声音。我已将 poweron.ogg 文件路径添加为 /system/media/audio/ui/poweron.ogg。bootanimation.zip 我也已在 /system/media/ 位置替换。

标签: androidanimationandroid-source

解决方案


系统从动画压缩文件 (bootanimation.zip) 中选择音频文件。

这是对 bootanimation 格式有完整解释的链接:

https://android.googlesource.com/platform/frameworks/base/+/master/cmds/bootanimation/FORMAT.md#bootanimation-format


推荐阅读