2009年4月24日 星期五

Use android emulator to play music

試著用android emulator 來播放音樂,

第一步,讓emualtor掛上一個sdcard image,
先使用android sdk裡的 mksdcard 來產生一個image。

$mksdcard 512M sdcard_for_android.so
$emulator -sdcard ./sdcard_for_android.so

接著就是把media file丟進sdcard space, for example
$adb push beat.ogg /sdcard

此時執行Music, 似乎還看不到丟進去的file...?
adb shell 進去,把 system_server 砍掉,讓它重跑。再進去Music,應可看到丟進去的音樂檔。
$ kill 'PID of system_server'

播放,似乎沒有聲音,重新run emulator,這時加入oss audio backend。
$emulator -sdcard ./sdcard_for_android.so -scale 0.5 -audio oss

執行Music,播放.... enjoy the music for a while....


android果然跟平常使用的環境不太一樣啊~~

1 則留言:

live3054 提到...
網誌管理員已經移除這則留言。