Menu

#248 Getting ICY meta-data ?

0.68
closed-invalid
nobody
icy (1)
5
2017-05-07
2017-04-16
fred vs
No

Hello.

How to do to get the ICY meta-data ?

I have try with this first:

mpg123_feature(MPG123_FEATURE_PARSE_ICY)

But this raise a error and the application crash ;-(

So, without this method, I try to get the data with:

mpg123_icy(mh,icy_meta)

This does not raise any error but... icy_meta is empty ;-(

How to do ?

Thanks.

Fre;D

Discussion

  • Thomas Orgis

    Thomas Orgis - 2017-04-17

    mpg123_feature(MPG123_FEATURE_PARSE_ICY)

    But this raise a error and the application crash ;-(

    What? Please elaborate. What version of mpg123 is this? What kind of
    error?

    So, without this method, I try to get the data with:

    mpg123_icy(mh,icy_meta)

    This does not raise any error but... icy_meta is empty ;-(

    First: Do you have an example stream? Best would be something that
    mpg123 the application also plays so that you can see it does show ICY
    meta info. Then … before you try to extract data using mpg123_icy, did
    you check if there should be data available?

    meta = mpg123_meta_check(mh);
    if(meta & (MPG123_NEW_ID3|MPG123_NEW_ICY))
    

    And finally ? how did you open the stream? Did you set
    MPG123_ICY_INTERVAL?

     
  • fred vs

    fred vs - 2017-04-17

    What version of mpg123 is this?

    It is with the very last mpg123 commit.

    First: Do you have an example stream?

    Huh, do you speak Pascal ? Because the example is in Pascal Object.

    ---> https://github.com/fredvs/uos

    Did you check if there should be data available?

    No but thanks for the tip, I will use it.

    Did you set MPG123_ICY_INTERVAL?

    No too, but how to set it ?

    Thanks Thomas.

    Fre;D

     
  • Thomas Orgis

    Thomas Orgis - 2017-04-17

    With test stream I meant the actual data you feed to mpg123 to decode, the URL you use to access the stream.

    The ICY metadata parsing relies on you parsing the stream headers (HTTP response) to determine the ICY interval. When you then give this value to libmpg123, it will use it to do ICY metadata extraction. Libmpg123 does not do any network protocol itself (announce ICY support, parse headers for interval value). This is done in the console mpg123 application, or in this case, should be done in your code.

    You set the ICY interval as a parameter using mpg123_param

    http://mpg123.org/api/groupmpg123init.shtml#gga73a8ff3363028b89afc72b3ea032b9cba904b9ea7e03ae0ec349087267bea20c8

     
  • fred vs

    fred vs - 2017-04-17

    With test stream I meant the actual data you feed to mpg123 to decode, the URL you use to access the stream.

    Here Pascal code to announce ICY support in network protocol:

    Http.RequestHeaders.Clear;
    Http.RequestHeaders.Add('Accept: icy-metadata:1');  // icy
    Http.Get(URL, FOutStream);
    

    And here Pascal code for mpg123 (resumed, without mpg123_param()):

    HandleSt := mpg123_new(nil, Err);
    mpg123_replace_reader_handle(HandleSt, @mpg_read_stream, @mpg_seek_url, nil);
    mpg123_open_handle(HandleSt, Pointer(InPipe));
    mpg123_icy(HandleSt, icy_data);
    

    I have to add ICY interval in mpg123_param().
    Many thanks Thomas. ;-)

    Fre;D

     

    Last edit: fred vs 2017-04-17
  • Thomas Orgis

    Thomas Orgis - 2017-05-07
    • status: open --> closed-invalid
     

Log in to post a comment.