简体   繁体   中英

Streaming Audio from server to Android App

I am kind of stuck on my app design and wondering, if some of you experts, could point me in the right direction.

I am working an Android App that shows how to pronounce different English words. When user clicks on a play button next to a word, corresponding audio file (prerecorded wav file) is played with Android media player. I have 2000 words and corresponding wav files (each file is between 1 to 2 seconds).

But the problem is, I can't pack all 2000 audio files into APP, as it will make APP too big. I am wondering, what is the best way of having the audio files on the server somewhere, and when user clicks play button next to a word, my APP plays from server. Are there any other ways of doing this?

Do I need streaming server for this (it's not live stream), if so would you please let me know some that host? Can I use Heroku?

Thanks for help Srini

You do not need a streaming server for that. A simple web pages server will do the job. Just put all your files in (maybe via ftp) to the server in a directory that you now exactly. From there, you can use the MediaPlayer class of android to play those sounds in streaming with the appropriate link to the file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM