Re: Audio Streaming in j2me
[QUOTE=devdhar.s;752351]Hi
I am doing audio Streaming in J2me , i am created Two player when First player fill buffer it start playing stream and in background second player start filling the buffer.
When first player complete the playing of stream,the second player start playing.
But In switching from first player to second player there is 1-3 seconds of delay.
Please help me how can i solve this issue.
Urgent!![/QUOTE]
Solution - you need to program it such a way that you provide an overlap between the two players, i.e. you start the 2nd player 1-3 sec's before the 1st player reaches its end.
Re: Audio Streaming in j2me
1-3 seconds is a lot, afaik if you use the PlayerListener interface and you get a END_OF_MEDIA signal you should be able to start the next one in about half a second...
But this only if you have prefetched and realized aforehand the player which needs to be started...
Overlapping the players will be very very difficult and device-dependant... You don't want to stay in a while loop continuosly checking the "time played" of the player to know if you are 1 or 3 seconds from the end... This obviously will keep your cpu pretty busy (doing nothing mostly) and if your application is somewhat big and graphical it will be very slow and laggy...
there is a reason why there aren't any decent streaming apps around, and that reason is not because nobody thought of it or tried to implement one ;)
Re: Audio Streaming in j2me
A workaround can be -- get the duration of the buffer or chunk that you are going to play, start it --start a new thread pre-fetch the next chunk and wait (sleep) for the duration left for the first player - 500ms and launch the next player.
No need to check the timeplayed, try with Player.getDuration() and put in some logic to take care of the time, next prefech and start of the next player.
Re: Audio Streaming in j2me
yup, there is only one problem, those 500ms will be device-dependant (some devices will need 500 ms, some 700 ms, some 300ms) and variable.. The same device will need less/more every single run... I can assure you that this has been tested severl hundreds of hours on different devices ;) Already very sophisticated algorithms have been thought of and developed which try to measure those timings, unfortunately the platform is not any good for that.. To begin with (as an example) the END_OF_MEDIA callback has a delay, which again is device dependent and again it fluctuates... Also obviously it's not running on a RTOS, and that is pretty annoying because a human will be able to distinguash a gap as low as 50 ms...
I know theoretically it sounds pretty easy or feasable, again do you have any streaming app which works good continuesly or for longer periods of time ?
Re: Audio Streaming in j2me
Yes, its easy to switch to RTSP or try progressive download where supported by the implementation for JSR 135 (S40 3rd edition onwards).
Try progressive_download; enable as an attribute to the midlets jad
[url]http://library.forum.nokia.com/topic/Design_and_User_Experience_Library/GUID-88483802-74EE-4C07-BCBF-2D907D600775.html[/url]
[url]http://library.forum.nokia.com/index.jsp?topic=/Java_Developers_Library/GUID-C5D3E0F5-72B9-4EE7-8BA7-20DE4A538FB8.html[/url]
Re: Audio Streaming in j2me
just be advised progressive download actually only works for the S40 platform... Which means that MOST S40 don't support 3g, which again means very very poor quality (as in bitrate) is supported...
And the rtsp implementation for the MMAPI works... barely... You want quality ? Don't go for rtsp...
I still have to hear a decent streaming player, the standard options that come with the MMAPI and/or rtsp and/or progressive download on S40 are very very lacking in quality... I guess that if you are happy with stut... stutt... stuttering audio or a bad 32 kbit mp3 stream you are well served...
Other codecs (like aac+) aren't supported that well unfortunately... Or at least not with the MMAPI, the realtime player which is shipped with most S60 on the other hand works decently...
Re: Audio Streaming in j2me
Hi
iam anew j2me developer and iam working now in aproject. one of project's function is to make audio streaming.I reached to code that make avideo streaming and it's working properly,but i cant make audio streaming.please help me to make audio streaming using http ,without rtsp.please if there is any code samples to help me.my mail is
[email]adel.fci.egy@gmail.com[/email]
thanks
Re: Audio Streaming in j2me
would you please help me with just a quick code snippet on how to stream my S40 nokia 300 camera, I want to test if possible to use it as autonome video resource with java (I want to use it over 3G network to watch its video), thanks
Re: Audio Streaming in j2me
Hello anis2005,
and welcome to Nokia Developer Discussion Boards!
If you are referring to how to use Nokia 300 for streaming video, you might want to check these resources:
[URL="http://www.developer.nokia.com/Community/Wiki/How_to_play_video_streaming_in_Java_ME"]How to play video streaming in Java ME[/URL]
[URL="http://library.developer.nokia.com/index.jsp?topic=/Java_Developers_Library/GUID-47302026-76F1-479E-ABED-FC4C3FD24533.html"]Java Developer's Library > Implementation notes > (JSR-135) Mobile Media API > Series 40 class and interface description > Streaming[/URL]
Regards,
r2j7
Re: Audio Streaming in j2me
Hi r2j7,
Thanks soo much for this really helpfull information, I really appreciate that,
I also want to share what I have also found in sun website :
[QUOTE]"Camera
MMAPI includes support for a camera, with a special locator capture://video used to create its Player. An application can use the VideoControl to display a viewfinder on the screen, then take a picture using VideoControl.getSnapshot(String imageType). The default image format is PNG. You can use the imageType parameter to select any other supported format, and query the system property video.snapshot.encodings to find out what formats are supported.
"[/QUOTE]
[URL="http://developers.sun.com/mobility/midp/articles/mmapioverview/"]http://developers.sun.com/mobility/midp/articles/mmapioverview/[/URL]
Hope this will be working once used on my phone, so i can access its camera from a second phone directly or over the Internet,
Regards,
Anis
Re: Audio Streaming in j2me
Hi
I am trying to develop a video streaming application whereby i need to use setMediaTime as i have one video clip at server which i need to show in parts. But the issue that i am facing is i am not able to setMediaTime on devices like E71, E72. The setMediaTime is working just for S60 5th edition and above. Any suggestion would be helpful?
Thanks
Neeraj
Re: Audio Streaming in j2me
Hi Everyone
We are developing an audio streaming application, can we define the access points from our application for streaming? Actually if streaming access point is defined as none so the player does not start giving an exception. Can we set the access point from our application?
Regards
Rahul
Re: Audio Streaming in j2me
Actually I don't think so, that wouldn't be very "safe", which is the idea of sandboxed J2ME...
Re: Audio Streaming in j2me
So we need to ask user to set the access points manually?