Administrator
|
This post was updated on .
---> https://sourceforge.net/p/mpg123/bugs/248/ [EDIT] Huh, I think that the problem is how to deal with icy_meta in: function mpg123_icy(mh: Tmpg123_handle; var icy_meta: PPChar) : integer. If result = 0 --> all ok, otherwise errors. Because when I connect to http://stream-uk1.radioparadise.com/mp3-128 The sound is fluent and, after each 10 seconds --> mpg123_icy(HandleSt, icy_data) --> result = 0 --> so it seems ok. But --> writeln(icy_data) --> nothing --> ;-( Fre;D |
I have looked at your code in mpg123 forum. You have to add icy header without "Accept:". Like this:
|
So I changed thread:
New property (read only) ... which is set in: Then in uos.pas after open handle: mpg123_param return 0 so no errors, StreamIn[x].httpget.IcyMetaInt contain also correct value but I'm still getting weird sounds and this output warnings: Maybe I'm setting param too late? |
Yep. Too late. Changed thread a little. Added OnIcyMetaInt event: Which is fired immediately when got header: Also changed thread to not start automatically: Then in uos added thread callback And run thread just before open: Finally weird warnings disappeared and call: ... return But I don't like this solution (especially CheckSynchronize require). Just did this for tests. At least we know now what was a reason |
So to sum up, mpg123_param(Data.HandleSt, MPG123_ICY_INTERVAL, X) has to be called before writting into pipe
|
Administrator
|
In reply to this post by Dibo
WoW, well done Dibo.
That is a detail, you did make it works, congrat. Sure you will find the best layout. At the moment I do have access only to a bad wfi point and not my working netbook. So I will test your victory asap. Many thanks. Fre;D |
Administrator
|
In reply to this post by Dibo
Hello Dibo. Huh, sorry but I do not catch what is DoIcyMetaInt ? Is it a new property in TThreadHttpGetter ? type TProc : procedure of object; TThreadHttpGetter = class(TThread) ... public DoIcyMetaInt : TProc; ... Is it Tuos_InStream.UpdateIcyMetaInterval, so at creation TThreadHttpGetter ---> StreamIn[x].httpget.DoIcyMetaInt := @StreamIn[x].UpdateIcyMetaInterval ; ? (I have try but data is not assigned with mpg123_icy(StreamIn[x].Data.HandleSt,pc); ). Thanks. Fre;D |
Ahh, sorry, forgot abotu that one:
|
Administrator
|
Thanks Dibo.
Aaargh, no more battery, ok, I will test tomorow. Fre;D |
Administrator
|
In reply to this post by Dibo
Hello Dibo. OK, I have committed your advices in last commit 5e680a4..06084a5. Sadly, the updated conswebstream demo gives always icy-data not assigned. Fre;D |
First, I'm not sure if commit it was good idea. This was just my draft . Also if internet stream has no support for icy-data then CheckSynchronize(10000); will freeze here for 10 seconds.
Second, how and where you call mpg123_icy()? |
Administrator
|
Maybe but it is how I work. And thanks to me to work that way : I just have a big crash on my pc and I am very happy that I did commit of my work (even if the commits are not perfect). Also uos is open-source for everybody. I find normal that, after asking help to fpc + mpg123 forum, if generous people gives answers, that I give this answers back to other people too. In last commit, uos_AddFromURL(..) has a new parameter : ICYenabled. This is set to disable by default. I hope that I will find the right way to make it work (if you do not want to give your secret). With uos_InputUpdateICY(PlayerIndex1,InputIndex1,theicytag), 30seconds after uos_Play(PlayerIndex1); Fre;D |
Ahh, it is fine then. I was worried that you added it as it is and it break something which worked fine so far |
Administrator
|
Like you know, connecting to Internet is a hard battle for me. So it is difficult to test-develop web stuffs. For example, for ICY data (thanks to you, fpc-forum and Thomas of mpg123) uos has all the tools to work. I just need some time and a (working) net-connection to finalize a working demo. Fre;D |
Hi all,
I found this very interesting Project. My question is, is it now possible, to get Meta Information about the radio stream? It is not completely clear after reading the post. To have addtional Information to the well working Stream, like Title and Artist in the GUI Application would be very nice. Regards fmann |
Administrator
|
This post was updated on .
> To have addtional Information to the well working Stream, like Title and Artist in the GUI Application would be very nice.
Hello. You may get TAG informations (like title, artist, date, album, ...) of the streaming file (mp3 or opus) like it was a local file. For additional infos, like radio-news, icy-metadata, it should work but I never try it (please read previous post). You may try the demos /uos/examples/conswebstream.lpi/prj, simplewebplayer.lpi/prj and simplewebplayer_fpgui.lpi/prj. Fe;D |
Hi, thnaks for the reply.
The changes stated in this post are already in the Units but in project ConsoleWebStream the Tag icy is empty in Runtime. In SimpleWebPlayer the meta Tags are not foreseen. Is there an example project where these Information already built in? |
Administrator
|
> but in project ConsoleWebStream the Tag icy is empty in Runtime.
> Is there an example project where these Information already built in? Are you talking about a example that can use/read icy tag? https://cast.readme.io/docs/icy If this, no, somebody with a working Internet link is welcome to test and explore it. I have to confess that I never used icy protocol and I do not know what kind of info it gives. I did add some code from Dibo (see previous posts) but did not test it. If you need the meta-tags from the file itself (like artist, album, etc), you may use the "classical" way like this: if uos_CreatePlayer(0) then if uos_AddFromURL(0,pchar(the_url)) <> -1 then begin TagTitle:= uos_InputGetTagTitle(0,0); TagArtist:= uos_InputGetTagArtist(0,0); TagAlbum:= uos_InputGetTagAlbum(0,0); TagDate:= uos_InputGetTagDate(0,0); TagComment:= uos_InputGetTagComment(0,0); TagTag:= uos_InputGetTagTag(0,0); ... Fre;D |
If this is working, would be ok for me.
I´ll test it. Thank you. |
Hi,
I did some testing about the Tags. I didn´t get it working. Could it be, that this is indeed only for MP3 Files? That would be a pity, because uos for radio streaming works very well. Any chance to get it working from your side? Regards |
Free forum by Nabble | Edit this page |