我一直在尝试在启动时添加声音,以便在运行 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
不走运,谁能发现我可能错过的东西?
谢谢