This post originated from an RSS feed registered with Java Buzz
by Fred Grott.
Original Post: Plesae Fix MediaPlayer to play Input Streams
Feed Title: ShareMe Technologies LLC-The Mobile Future
Feed URL: http://www.jroller.com/shareme/feed/entries/rss
Feed Description: A Weblog about Java programming and digital convergence on mobile devices in such areas as P2P and collaborative technology.
Going through enabling certain features in PhoneGap for Android and found that I cannot easily play audio files from the android_asset folder as its a security violation as far as MediaPlayer is concerned. I couk dopen a socket and I guess store a temp file and than sendit to MdiaPlayer but that is too CPU intensive and I do not feel like subjecting users to SoundPOol in its current form.
What I have come up with is the native PhoneGap code for Android loads two sounds in the raw resoruce folder and uses them. I check via if staements to see if correct filemane has been supplied and choose the int resorucve base don that if statements. Want more soudns than suppleid, than you have to add them and change the PhoneGap source.
Yes, an ugly hack but it will have to do until SDK version 1.1 and yes I am putting in the SDK vrsion checking. Thus, Google and OHA please fix, you could probably improve SoundPool and most of us woukd be happy about it.