为 Froyo 2.2 Droid 添加启动声音

发布于 2024-09-13 02:42:23 字数 1042 浏览 8 评论 0原文

我一直在尝试在启动时添加声音,以便在运行 Froyo 2.2 ROM 的机器人上运行启动动画。

这是我到目前为止所尝试过的:

添加到 init.rc

###Bootsound - Safe to Delete: Start ###

service bootsound /system/bin/bootsound
        user media
        group audio
        disabled
        oneshot

on property:init.svc.bootanim=running   # to correct timing
        start bootsound

on property:dev.bootcomplete=1
        stop bootsound
### Bootsound - Safe to Delete: End ###

在 /system/bin 中创建 bootsound

#!/system/bin/sh
#bootsound - plays a sound at boot

bprop=/system/build.prop
grepprop() { x=`grep "^$1=" $bprop | head -n 1`; echo $x | cut -d = -f 2; }

play=`grepprop "ro.config.play.bootsound"`

if [ "$play" = "1" ]; then
        stagefright -a -o /system/media/android_audio.mp3
fi
exit 0

添​​加到 build.prop

### Safe to Delete: Start ###
ro.config.play.bootsound=1
### Safe to Delete: End ###

当然还添加了 android_audio.mp3 文件到 /system/media

不走运,任何人都可以发现我可能有什么错过了?

谢谢

I have been attempting to add sound on boot to run with the boot animation on a droid running Froyo 2.2 ROM.

This is what I have tried this far:

Added to init.rc

###Bootsound - Safe to Delete: Start ###

service bootsound /system/bin/bootsound
        user media
        group audio
        disabled
        oneshot

on property:init.svc.bootanim=running   # to correct timing
        start bootsound

on property:dev.bootcomplete=1
        stop bootsound
### Bootsound - Safe to Delete: End ###

Created bootsound in /system/bin

#!/system/bin/sh
#bootsound - plays a sound at boot

bprop=/system/build.prop
grepprop() { x=`grep "^$1=" $bprop | head -n 1`; echo $x | cut -d = -f 2; }

play=`grepprop "ro.config.play.bootsound"`

if [ "$play" = "1" ]; then
        stagefright -a -o /system/media/android_audio.mp3
fi
exit 0

Added to build.prop

### Safe to Delete: Start ###
ro.config.play.bootsound=1
### Safe to Delete: End ###

And of course added the android_audio.mp3 file to /system/media

No luck, can anyone spot what I may have missed?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

对不⑦ 2024-09-20 02:42:23

第一次英语翻译,我为使用单点表示歉意。
当尝试在 Android 2.3 GingerBread bootsound 上查看您的帖子时,发现问题确实自然发生。
Bootsound 在启动设备期间,遇到以下错误。

bootsound:12:语法错误:文件结尾意外(期望“然后”)

设备当前正在使用 LG Optimus Black(Android 2.3 Gingerbread)

First English translator, I apologize for using the single point.
While attempting to see your post when applied to Android 2.3 GingerBread bootsound have found the problem really happen organically.
Bootsound during the Boot Device, the following error was encountered.

bootsound: 12: Syntax error: end of file unexpected (expecting "then")

Device is being used currently the LG Optimus Black (Android 2.3 Gingerbread)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文