I want to play audio from the live server. I don't want to download these audio files. Format of these files are mp3.working on android java.
If you want to play the MP3 in the GUI, use the “-gui” flag. If you want to disable the GUI, then use “-nogui” instead. Looping is also supported. THe following command will run your selected MP3 file(s) for 100 times.
To link to an MP3 file, you must first upload the MP3 file either to a cloud storage service like Google Drive or iCloud, or to an online music service like SoundCloud. After uploading the music, you can share it via the link.
Click on Media from the top menu bar. Then from the drop-down list, select Open File. In the window that appears, choose the mp3 file that you want to play and click on Open. It will instantly play the mp3 file in VLC player.
try {
MediaPlayer player = new MediaPlayer();
player.setAudioStreamType(AudioManager.STREAM_MUSIC);
player.setDataSource("http://xty/MRESC/images/test/xy.mp3");
player.prepare();
player.start();
} catch (Exception e) {
// TODO: handle exception
}
Try doing this:
MediaPlayer mp = new MediaPlayer(/*Your-Context*/);
mp.setDataSource(/*MP3 file's Url*/);
mp.setOnPreparedListener(new OnPreparedListener(){
onPrepared(MediaPlayer mp)
{
mp.start();
}
});
mp.prepareAsync();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With