问题描述
Android或Java中是否有可以播放电台直播的第三方库?
Is there any 3rd-party library in Android or Java that can play radio live stream?
File extension: .asx
MIME type: video/x-ms-asf
不幸的是,不支持此格式!
Unfortunately, MediaPlayer does not support this format!
以下是直播的网址:http:// 38.96.148.75 / SunnahAudio
Here is the url of the live stream: http:// 38.96.148.75 /SunnahAudio
编辑:
我能够将 .asf
文件转换为 .mp3
使用文件:
I was able to convert .asf
file to .mp3
file by using JAVE:
File source = new File("sound.asf");
File target = new File("target.mp3");
AudioAttributes audio = new AudioAttributes();
audio.setCodec("libmp3lame");
audio.setBitRate(new Integer(64000));
audio.setChannels(new Integer(1));
audio.setSamplingRate(new Integer(22050));
EncodingAttributes attrs = new EncodingAttributes();
attrs.setFormat("mp3");
attrs.setAudioAttributes(audio);
Encoder encoder = new Encoder();
encoder.encode(source, target, attrs);
但是,我正在流式传输 .asf
在线,我不确定我是否可以流式传输电台,将其转换为 .mp3
,并立即播放!
However, I'm streaming the .asf
online and I am not sure if I could stream the radio station, convert it to .mp3
, and immediately play it!
EDIT2:
我为任何人提供500+代表提供完整的工作解决方案在Android上播放 .asf
直播。基本上,我想在Android上播放这个广播电台(作为可以):
I offer 500+ rep for anyone provides a full and working solution to play .asf
live stream on Android. Basically, I want to play this radio station on Android (as xiialive
can do):
http://38.96.148.75/SunnahAudio
推荐答案
如果您在VLC播放器中打开流的网址,则可以使用 WMA
MMS 流> codec mmsh://38.96.148.75/SunnahAudio?MSWMExt = .asf
这是一个开源项目使用 libmms
和 libffmpeg
到
从 mms://
流中获取WMA内容并播放它。
我希望它能解决您的问题。
If you open url of the stream in VLC player you can find out that it is an MMS
stream using WMA
codec mmsh://38.96.148.75/SunnahAudio?MSWMExt=.asf
Here is an open source project aacplayer-android which uses libmms
and libffmpeg
to get WMA content from mms://
stream and play it.
I hope it solves your problem.
这篇关于如何播放电台直播.asx video / x-ms-asf?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!