It is currently Tue May 23, 2017 9:47 am



Welcome
Welcome to rfobasic

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. In addition, registered members also see less advertisements. Registration is fast, simple, and absolutely free, so please, join our community today. **You are not required to provide truthful information to any registration questions. Be whomever you wish to be.!


Post new topic Reply to topic  [ 15 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Audio.load and Audio.play would support live streams
Unread postPosted: Mon Nov 14, 2016 8:31 am 
Offline

Joined: Mon Nov 14, 2016 6:49 am
Posts: 39
Dear developers,
Do you think, that those commands could support Internet radio playback in future? Or is it possible to play live streams for now? Sure, only audi format which are being supported by Android components. So no protocols or audio formats which Android core component do not support for now. So no RTMP streams for watching Internet TV.


Report this post
Top
 Profile  
 
 Post subject: Re: Audio.load and Audio.play would support live streams
Unread postPosted: Mon Nov 14, 2016 9:17 am 
Offline
User avatar

Joined: Thu Jan 08, 2015 11:28 am
Posts: 1088
Location: .NET
this should be moved to original BASIC!'s Enhancement Requests enhancement-requests-f5.html
TooBASIC is a derivative of BASIC! that works on Windows.

either way, if BASIC! doesn't implement direct audio streaming first, i might take a look at it after i finish porting all the commands.

as for video streaming i don't think it's feasable even with BASIC! because it requires some more advanced knowledge and would increase the size quite a lot to handle decoding. or, well, it would just launch an intent to a video player on your phone, so it can read the stream instead.

_________________
https://github.com/evolbug
http://toobasic.jimdo.com


Report this post
Top
 Profile  
 
 Post subject: Re: Audio.load and Audio.play would support live streams
Unread postPosted: Mon Nov 14, 2016 9:40 am 
Offline
User avatar

Joined: Sun Nov 23, 2014 8:15 am
Posts: 2185
Location: romania
I think, this can be done using html mode from BASIC


Report this post
Top
 Profile  
 
 Post subject: Re: Audio.load and Audio.play would support live streams
Unread postPosted: Mon Nov 14, 2016 9:50 am 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5518
Location: Paris, France
Moved to BASIC!'s Enhancement Requests

_________________
- Creator of the Android BASIC! Compiler


Report this post
Top
 Profile  
 
 Post subject: Re: Audio.load and Audio.play would support live streams
Unread postPosted: Wed Nov 16, 2016 11:17 am 
Offline

Joined: Mon Nov 14, 2016 6:49 am
Posts: 39
I Am very sorry that I have created stand alone sub threat inside enhancement request. I Am deeply appreciating Rhbasic and all team. Because yours basic is really fast and contain many commands. My dream was to create Internet radio player app.
What did you mean by HTML mode?
Should I use
HTML.open
HTML.LOAD.URL "http://amp1.cesnet.cz:8000/cro1.ogg"

But I can not load any WEB page by using this procedure. Even if I try to load standard HTML page. System shows me empty list. And I do not know, if I do not do something wrong. I have enabled all permissions to be sure, that it is not problem caused by disabled permission. But no.
I use Android 4.1.2. May be, that using routines can not access The Internet in this Android version. I use latest version of Quick apk and Rh basic. Latest stable version of those components.

Thank you very much for yours support.


Report this post
Top
 Profile  
 
 Post subject: Re: Audio.load and Audio.play would support live streams
Unread postPosted: Wed Nov 16, 2016 11:24 am 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5518
Location: Paris, France
Hello Jan,

Try to take a look at google results for "html5 webradio player github".

The idea is to write an html5 page that plays a webradio, then load it in BASIC! HTML mode.

First try it in BASIC! Editor.
Only when everything is working should you use Quick APK or other compiler.

Nicolas

_________________
- Creator of the Android BASIC! Compiler


Report this post
Top
 Profile  
 
 Post subject: Re: Audio.load and Audio.play would support live streams
Unread postPosted: Wed Nov 16, 2016 12:53 pm 
Offline

Joined: Mon Nov 14, 2016 6:49 am
Posts: 39
Dear Nicolas,
Thank You very much.
I hope, that html.open
Html.loadurl
Will be able to load html page.
I will run example program html edit to see if it is working.
Fortunately, there are some screen reader compatible commands in Basic. Because many of sighted developers are using graphic mode. It creates very nice GUIS. I will do my best to get familiar with techniques for GUI creation.
And I will try "html5 webradio player if it will work.


Report this post
Top
 Profile  
 
 Post subject: Re: Audio.load and Audio.play would support live streams
Unread postPosted: Fri Nov 18, 2016 11:09 am 
Offline

Joined: Mon Nov 14, 2016 6:49 am
Posts: 39
Dear developers,
I Am very sorry but I can not receive HTML5 approach. Because it has some disadvantages. Uses webview Android component. Only to play .ogg live stream? I love fast menus created by using select command. I have looked at Basic source code. And I have found out, that audio.play command uses Android media component. The same component, which Android Java developers are being used to play live audio streams.
So I have analysed various WEB pages. I have found perfect and useful article from Google experts about media player Android core component.
https://developer.android.com/guide/top ... layer.html

Here is their little part of code to open live stream.
Playing from a remote URL via HTTP streaming looks like this:
String url = "http://........"; // your URL here
MediaPlayer mediaPlayer = new MediaPlayer();
mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
mediaPlayer.setDataSource(url);
mediaPlayer.prepare(); // might take long! (for buffering, etc)
I Am ready to test new Basic, if Audio.load would support to open live stream. So Audio.play command will allow to play live stream.
HTML5 players are constructed so one of its part must be on server. And client part can reside on The device. I want to have play and other features on my own control. I do not want to depend on external service. If you are sure, that incorporating live sreams is so extremely complex, I hope, that somebody will have The tip how to modify HTML5 opensource player so it would be The part of compiled Rfo-basic program.
I think it well, because Android media component support several video formats. It is no need to write thousants of Java lines to support this feature.
Please keep in mind, that multimedia support is more and more important. i do not want this feature only for myself. Sure, I do not want bother you. Sure, I have several Internet radio players at home, it is based on Java or C++ code by using Mosync Video example. But why do not implement this feature for Rfo-Basic? I Am sure, that it is not inpossible.
Sure, we do not want to guarantee, that every file type, which will be opened to end user will be supported by his version of Android.
In this case, yes, advanced user of Basic can use HTML5 player. But User, who will want to develop apps not for Talkback and other screen readers users.


Report this post
Top
 Profile  
 
 Post subject: Re: Audio.load and Audio.play would support live streams
Unread postPosted: Sat Dec 03, 2016 10:07 am 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5518
Location: Paris, France
You can download a test version of BASIC! that allows to AUDIO.LOAD an internet webradio.

This test version can be installed near the official BASIC! and run along it without problem.

Test version can be downloaded here: http://laughton.com/basic/programs/apks/BASICTest_19001.apk

This test version is actually a snapshot of the current GitHub repository, with many enhancements: AUDIO.LOAD but also ZIP commands, RUN improvements, PROGRAM.INFO command...

Nicolas

_________________
- Creator of the Android BASIC! Compiler


Report this post
Top
 Profile  
 
 Post subject: Re: Audio.load and Audio.play would support live streams
Unread postPosted: Sat Dec 03, 2016 10:09 am 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5518
Location: Paris, France
And here is a test program:

Code:
e$="http://amp1.cesnet.cz:8000/cro1.ogg"
?"audio.load \""+e$+"\""
c0=clock()
audio.load a, e$
if !a then end geterror$()
?"stream opened in "+int$((clock()-c0)/1000)+"s"
?"audio.play"
audio.stop
audio.play a
?"hit back or touch this line to stop"
do
pause 10
until 0
onbackkey:
onconsoletouch:
audio.stop
end "-stopped-"


Nicolas

_________________
- Creator of the Android BASIC! Compiler


Report this post
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 15 posts ]  Go to page 1, 2  Next


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
suspicion-preferred