playing audio stream in blackberry - java

I am doing an audio playing Application in blackberry.When i pass a live url stream,it works,but when my url is a fixed one of size say 50 mb.It shows error,can anyone tell me the reason for it?

have you tried to buffer and play the media using custom buffer class or just trying to pass url of media file to player.
if you pass url of media directly (not a streaming link but an mp3 file link for example) then device will try to download the file and then play the file and blackberry has 2 or 1 MB file size limit to download a file.
any how unless you paste some code here it is hard to answer your exact query. I also like to share this link for streaming media over internet.
http://supportforums.blackberry.com/t5/Java-Development/Streaming-media-Start-to-finish/ta-p/488255

Related

Create a new MP4 video and mux MP3 file into it

I want to find a way to create a new MP4 container and add an MP3 file into it. Whether the MP3 file is to be encoded or not does not matter to me. Is there any easy way to do this without using ffmpeg? I have found the following example for muxing:
android - How to mux audio file and video file?
Though, it has issues and also it is supposed to mux the audio file into an existing video.
Can someone point me to a guide or at least in the right direction to accomplish what I need?
U can do this using MediaCodec and MediaMuxer but right now i think mp3 is not supported u should first decode mp3 to wav and encode to supported format like aac using MediaExtractor and MediaCodec and then u can add to mp4 container using Muxer. U might find this link helpful https://www.sisik.eu/blog/android/media/mix-audio-into-video

How to download/store videos into database using java?

I want to write a program which allows me to download the video of a certain link and store it into database. I am able to retrieve the link of the video but I can't download it into my computer or database. Lets say my link is "www.abcde.com/12345" and when i click this link, I can watch the video. So How do I download/store this video into my database using java ? I read about inputstream, httpconnection and getV , filereader and whatnot but I just dont know where to start.
1. Link
The link you enter by browser to watch a video is rather not going to be link which you can use in your application to download the content of a file. Link you enter by browser is probably a reference to some web video player
In your java application a link to original resource file with the video content will be neccessary.
2. Database storage of a video
Do you really need to store video content in a database?
There are plenty more options (like for example storing only reference to file path)
I reccomend you to read this article
https://wiki.postgresql.org/wiki/BinaryFilesInDB

How can I stream in android with ftp server?

I can upload and download files on my android app. However, I wish to stream video and audio over 3g/4g like an 'ES File Explorer'. But the problem is I couldn't approach it.
Could anybody tell me a method about ES File Explorer's streaming skill?

Play m4a files in Java

I want to create a media player in Java. The mp3 support already works with the JLayer library but which library can play m4a files?
I read about vlcj here on stackoverflow, but this seems to depend on Swing/AWT which I wouldn't use because I want to port the application to Android later on.
Have you looked at JAAD? It's a Javasound SPI that decodes AAC audio, I've used it with success previously.
Note that m4a is a container format, and while it usually contains (in my experience) AAC audio, in theory it could contain other formats instead.
You can find some information about getting it working without Javasound (and a test case) here.
This answer is indirect. I don't really know anything about m4a files. But what I have found is an open source library that can stream them as a flash server named red5. It's written in Java so theoretically you should be able to browse their code to figure out how to do it.
Hopefully someone here can give a more direct answer, this is the best I can do.
If you have Java 7 or later, you have access to the Javafx library. You can also use your media player (like iTunes or Windows Media Player) to convert to the simpler mp3 version and run that. I wouldn't recommend .wav files as they have significantly more data usage than mp3s, (which condense the file size by compressing the .wav data and omitting inaudible and otherwise garbage-y data).
import javafx.scene.media.*;
String name = "song.mp3";
Media song = new Media(name);
MediaPlayer player = new MediaPlayer(song);
player.play();

Audio Streaming on Android

I need to create an audio streamer for Android. I want it to play MP3(and other formats too if possible). I also want to be able to progressive download the audio. Does anyone knows a good way to do that?
Thanks!
You should start by checking this link: http://developer.android.com/guide/topics/media/index.html
Apparently this is already done for video, since you can specify a URL as the source for your stream.
You also will have to check some references about audio streaming and the size of the buffering you should use, as well as its dependency with the rate at which you're getting data from the stream in question.

Categories

Resources