简体   繁体   English

使用来自无限输入的原始数据并在设备上播放

[英]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. 我想知道如何从无限输入流(例如,互联网广播)中捕获数据(媒体)并在android设备上播放。我经历的大多数教程都告诉我使用MediaPlayer类。 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? 你检查过AudioRecord类了吗? 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. 有了它,您可以录制来自MIC的音频源并读入byte [],从byte []中读出的类将是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 抱歉

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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