简体   繁体   中英

using raw-data from an infinite input and playing it on the device

I would like to know how to capture data(media) from an infinite input stream(eg. internet radio) and play it on the android device.Most of the tutorials i have gone through, tell me to use the MediaPlayer class. But the problem is that i want to capture that raw data in a byte array and then play it from that byte array itself.Does anyone know how to do this?

have you checked the AudioRecord class? with it you can record audio from sources, ie a MIC and read into a byte[], the class for reading out of a byte[] would be AudioTrack. please find the links within this post.

hope it will help.

as you said, you want to capture from internet radio, i am not sure how to do that. sorry

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