为 Froyo 2.2 Droid 添加启动声音
我一直在尝试在启动时添加声音,以便在运行 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
第一次英语翻译,我为使用单点表示歉意。
当尝试在 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)