Problem Icy-MetaData:1
I created an mp3 file named test.mp3 by streaming curl output (webradio)
I stop creating the test.mp3 file after 10 seconds.
Then
I read the file test.mp3 with (mpg123 -vt test.mp3) sees OUTPUT
OUTPUT CURL
curl http://stream.c9.fr/c9.mp3 > test.mp3
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 283k 0 283k 0 0 28056 0 --:--:-- 0:00:10 --:--:-- 23893^C
OUTPUT mpg123
./mpg123 -vt test.mp3
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
version 1.25.10; written and copyright by Michael Hipp and others
free software (LGPL) without any warranty but with best wishes
Decoder: x86-64 (SSE)
Trying output module: test, device: <nil></nil>
Terminal control enabled, press 'h' for listing of keys and functions.
Playing MPEG stream 1 of 1: test.mp3 ...
MPEG 1.0 L III cbr192 44100 j-s
456+000 00:11.91+00:00.00 --- 100=100 192 kb/s 627 B acc 0 clip p+0.000
[0:11] Decoding of test.mp3 finished.
Until no problem the file (test.mp3) is read without problem.
When I add the parameter to curl -H "Icy-MetaData: 1" it means add in the stream the stream (webradio) the metadata like (StreamTitle) the whole thing is generated in a file at the output (file test.mp3 ) see OUTPUT example:
curl -H "Icy-MetaData:1" -v http://stream.c9.fr/c9.mp3 > test.mp3
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying 66.70.200.63...
GET /c9.mp3 HTTP/1.1
Host: stream.c9.fr
User-Agent: curl/7.64.1
Accept: /
Icy-MetaData:1
What I can not understand is that reading with mpg123 the file test.mp3 is read with errors see OUTPUT mpg123
OUTPUT mpg123
mpg123 -vt test.mp3
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
version 1.14.4; written and copyright by Michael Hipp and others
free software (LGPL/GPL) without any warranty but with best wishes
Decoder: x86-64 (SSE)
Playing MPEG stream 1 of 1: test.mp3 ...
MPEG 1.0, Layer: III, Freq: 44100, mode: Joint-Stereo, modext: 2, BPF : 627
Channels: 2, copyright: No, original: Yes, CRC: No, emphasis: 0.
Bitrate: 192 kbit/s Extension value: 0
Frame# 24 [ 386], Time: 00:00.62 [00:10.08], RVA: off, Vol: 100(100)Note: Illegal Audio-MPEG-Header 0x69746c65 at offset 16008.
Note: Trying to resync...
Note: Skipped 65 bytes in input.
Frame# 48 [ 361], Time: 00:01.25 [00:09.43], RVA: off, Vol: 100(100)Note: Illegal Audio-MPEG-Header 0xeafffbb2 at offset 32373.
Note: Trying to resync...
Note: Skipped 1 bytes in input.
Frame# 72 [ 337], Time: 00:01.88 [00:08.80], RVA: off, Vol: 100(100)[layer3.c:454] error: big_values too large!
[layer3.c:454] error: big_values too large!
Note: Illegal Audio-MPEG-Header 0x9ffffbb2 at offset 48674.
Note: Trying to resync...
Note: Skipped 1 bytes in input.
Frame# 96 [ 313], Time: 00:02.50 [00:08.17], RVA: off, Vol: 100(100)Note: Illegal Audio-MPEG-Header 0xe9fffbb2 at offset 64349.
Note: Trying to resync...
Note: Skipped 1 bytes in input.
Frame# 120 [ 289], Time: 00:03.13 [00:07.54], RVA: off, Vol: 100(100)Note: Illegal Audio-MPEG-Header 0x79fffbb2 at offset 80650.
Note: Trying to resync...
Note: Skipped 1 bytes in input.
Frame# 152 [ 257], Time: 00:03.97 [00:06.71], RVA: off, Vol: 100(100)Note: Illegal Audio-MPEG-Header 0x0ffffbb2 at offset 96325.
Note: Trying to resync...
Note: Skipped 1 bytes in input.
Frame# 176 [ 233], Time: 00:04.59 [00:06.08], RVA: off, Vol: 100(100)Note: Illegal Audio-MPEG-Header 0x4dfffbb2 at offset 112626.
Note: Trying to resync...
Note: Skipped 1 bytes in input.
Frame# 200 [ 209], Time: 00:05.22 [00:05.45], RVA: off, Vol: 100(100)Note: Illegal Audio-MPEG-Header 0xb1fffbb2 at offset 128301.
Note: Trying to resync...
Note: Skipped 1 bytes in input.
Frame# 224 [ 185], Time: 00:05.85 [00:04.83], RVA: off, Vol: 100(100)Note: Illegal Audio-MPEG-Header 0x49fffbb2 at offset 144602.
Note: Trying to resync...
Note: Skipped 1 bytes in input.
Frame# 248 [ 161], Time: 00:06.47 [00:04.20], RVA: off, Vol: 100(100)Note: Illegal Audio-MPEG-Header 0x10fffbb0 at offset 160277.
Note: Trying to resync...
Note: Skipped 1 bytes in input.
Frame# 280 [ 129], Time: 00:07.31 [00:03.36], RVA: off, Vol: 100(100)Note: Illegal Audio-MPEG-Header 0x7ffffbb2 at offset 176578.
Note: Trying to resync...
Note: Skipped 1 bytes in input.
Frame# 304 [ 105], Time: 00:07.94 [00:02.74], RVA: off, Vol: 100(100)Note: Illegal Audio-MPEG-Header 0x41fffbb2 at offset 192252.
Note: Trying to resync...
Note: Skipped 1 bytes in input.
Frame# 328 [ 81], Time: 00:08.56 [00:02.11], RVA: off, Vol: 100(100)Note: Illegal Audio-MPEG-Header 0x88fffbb2 at offset 208554.
Note: Trying to resync...
Note: Skipped 1 bytes in input.
Frame# 352 [ 57], Time: 00:09.19 [00:01.48], RVA: off, Vol: 100(100)Note: Illegal Audio-MPEG-Header 0x41fffbb2 at offset 224228.
Note: Trying to resync...
Note: Skipped 1 bytes in input.
Frame# 376 [ 33], Time: 00:09.82 [00:00.86], RVA: off, Vol: 100(100)Note: Illegal Audio-MPEG-Header 0x0cfffbb2 at offset 240530.
Note: Trying to resync...
Note: Skipped 1 bytes in input.
Frame# 400 [ 9], Time: 00:10.44 [00:00.23], RVA: off, Vol: 100(100)Note: Illegal Audio-MPEG-Header 0x4dfffbb2 at offset 256204.
Note: Trying to resync...
Note: Skipped 1 bytes in input.
Frame# 409 [ 1], Time: 00:10.68 [00:00.02], RVA: off, Vol: 100(100)
[0:10] Decoding of test.mp3 finished.
if I put the option "Icy-MetaData: 1" I have the same problem with my streaming program of (webradio) the error and in function mpg123_decode_frame example:
err = mpg123_decode_frame(mh, &frame_offset, &audio, &done);
in the mpg123_feed function I do not have any example errors:
mpg123_feed(mh, (const unsigned char *) DataBufferMP3, Counternmemb);
is there not a way to with the option "Icy-MetaData: 1" to play the stream with (mpg123_decode_frame) without errors of messages:
Frame# 24 [ 386], Time: 00:00.62 [00:10.08], RVA: off, Vol: 100(100)Note: Illegal Audio-MPEG-Header 0x69746c65 at offset 16008.
Note: Trying to resync...
Note: Skipped 65 bytes in input.
to skip the metadata and read only mp3 streams.
thank you
Well, what do you expect from mpg123 in this case? You demand the server to interrupt the MPEG stream with ICY metadata blobs and call mpg123 without a hint about these interruptions. To the decoder, it looks like a damaged stream. The ICY metadata can interrupt the MPEG data at any point, without regard to frame headers etc.
But you are lucky, there is a solution:
I just noticed that this is not documented in the man page, only in the long help output.
I did tests online with mpg123 --icy-interval 16000
it's ok it works
How to implement in my program I saw with:
if (mpg123_param (mh, MPG123_ICY_INTERVAL, 16000, 0) == MPG123_OK)
when it's less than 16000 (mpg123_param (mh, MPG123_ICY_INTERVAL, 16000, 0) tells me it's ok.
How to make the interval at 16000 example
if (mpg123_param (mh, MPG123_ICY_INTERVAL, 16000, 0) == MPG123_OK)
{
std :: cout << << displays 16000 "<< std :: endl;
}
and display "displays 16000" every 16000.
thank you
I do not quite understand. You call mpg123_param() once before starting the decoding, not all the time. You tell the decoder which ICY interval to expect and it will cut out the metainfo out of the stream accordingly. Changing the parameter in between will be confusing at best.
include <curl curl.h=""></curl>
include <mpg123.h></mpg123.h>
include <ao ao.h=""></ao>
include <iostream></iostream>
include <string></string>
include <cstring></cstring>
include <sstream></sstream>
define BITS 8
mpg123_handle mh = NULL;
ao_device dev = NULL;
int octet = 0;
std::string str = "";
int CounterBuffer = 0; //Counter
size_t header_callback(char buffer, size_t size, size_t nitems, void userdata)
{
/
char str = NULL;
}
size_t play_stream(void buffer, size_t size, size_t nmemb, void userp)
{
int err;
off_t frame_offset;
unsigned char *audio;
size_t done;
ao_sample_format format;
int channels, encoding;
long rate;
}
int main(int argc, char *argv[])
{
if(argc < 2)
return 0;
}
OUTPUT
./player http://stream.c9.fr/c9.mp3
ICY INTERVAL OK
icy-br:192
ice-audio-info: channels=2;samplerate=44100;bitrate=192
icy-description:C9 Radio - Only Hits! - c9.fr
icy-genre:Top40 Hits Club Pop Rock Urban
icy-name:C9 Radio - Only Hits! - c9.fr
icy-url:https://www.c9.fr/
icy-metaint:16000
1 octet : 3
total octet : 48
length StreamTitle : 36
StreamTitle : StreamTitle='Rihanna - Unfaithful';
Le Header est termine : 16048
Note: Illegal Audio-MPEG-Header 0x6c273b00 at offset 16033.
Note: Trying to resync...
Note: Skipped 49 bytes in input.
1 octet : 0
total octet : 0
length StreamTitle : 0
StreamTitle :
Le Header est termine : 16000
Note: Illegal Audio-MPEG-Header 0x0dfffbb2 at offset 32382.
Note: Trying to resync...
Note: Skipped 1 bytes in input.
1 octet : 0
total octet : 0
length StreamTitle : 0
StreamTitle :
Le Header est termine : 16000
Note: Illegal Audio-MPEG-Header 0xc9fffbb2 at offset 48057.
Note: Trying to resync...
Note: Skipped 1 bytes in input.
In play_stream I'm doing a test with mpg123_meta_check but nothing is happening
It can be seen that at OUTPUT ICY Interval is active.
In play_stream I loop for (int i = 0; i <nmemb; i ++) to compute the streamTitle we can see the streamtitle in the OUTPUT.
Thank You
here is the file
I don't have time right now for a debugging session, but can you prepare a small piece of stream
dump with a few ICY intervals in it so that we can compare any testing? A piece of 100K should
not be so troublesome copyright-wise, I hope. If you rather not want to attach it here, anyway,
mail it to maintainer@mpg123.org .
Last edit: Thomas Orgis 2019-05-18
Ah, sorry. After testing with the doc/examples/mpglib.c example program, I realized that you are right. When you use mpg123_open_feed(), libmpg123 does not do the ICY parsing. I implemented this only for the other stream readers.
I see that the documentation was not explicit about this, but it did not occur to me that one would first open the stream and then set ICY_INTERVAL. If you set the parameter first and then open the stream, you get this:
The setting of ICY_INTERVAL makes libmpg123 set up different routines for reading on opening the stream. The routines for ICY do not exist in the feeder case.
The reason is that I only wrote the feeder API as a direct replacement for the old mpglib. I did not expect people to use it by default for future projects. You can achieve your custom stream handling with full support for mpg123 features by using mpg123_replace_reader_handle() to plug in your own I/O.
Can that work for your case? Alternatively, if you have to stay with the feeder, you'll just have to cut out the ICY block each 16000 bytes yourself here.
Alternatively, if you have to stay with the feeder, you'll just have to cut out the ICY block each 16000 bytes yourself here.
I tried to cut the ICY block every 16,000 bytes. it does not work he always finds the error message
Frame# 24 [ 386], Time: 00:00.62 [00:10.08], RVA: off, Vol: 100(100)Note: Illegal Audio-MPEG-Header 0x69746c65 at offset 16008.Note: Trying to resync...Note: Skipped 65 bytes in input.
I cut the buffer that is to say example:
unsigned char DataBufferMP3 = (unsigned char ) malloc(nmemb);
for (int i = 0; i < nmemb; i++){ if(CounterBuffer <= 15999) DataBufferMP3[i] = ((const unsigned char *) buffer)[i];
Thank youDidier
Ah, sorry. After testing with the doc/examples/mpglib.c example program, I realized that you are right. When you use mpg123_open_feed(), libmpg123 does not do the ICY parsing. I implemented this only for the other stream readers.
I see that the documentation was not explicit about this, but it did not occur to me that one would first open the stream and then set ICY_INTERVAL. If you set the parameter first and then open the stream, you get this:
[src/libmpg123/readers.c:1129] error: Feed reader cannot do ICY parsing!
The setting of ICY_INTERVAL makes libmpg123 set up different routines for reading on opening the stream. The routines for ICY do not exist in the feeder case.
The reason is that I only wrote the feeder API as a direct replacement for the old mpglib. I did not expect people to use it by default for future projects. You can achieve your custom stream handling with full support for mpg123 features by using mpg123_replace_reader_handle() to plug in your own I/O.
Can that work for your case? Alternatively, if you have to stay with the feeder, you'll just have to cut out the ICY block each 16000 bytes yourself here.
[bugs:#278] Problem Icy-MetaData:1
Status: open
Group: 0.68
Created: Wed May 15, 2019 10:03 AM UTC by Didier Castellacci
Last Updated: Sat May 18, 2019 09:15 AM UTC
Owner: nobody
Problem Icy-MetaData:1
I created an mp3 file named test.mp3 by streaming curl output (webradio)
I stop creating the test.mp3 file after 10 seconds.
Then
I read the file test.mp3 with (mpg123 -vt test.mp3) sees OUTPUT
OUTPUT CURL
curl http://stream.c9.fr/c9.mp3 > test.mp3
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 283k 0 283k 0 0 28056 0 --:--:-- 0:00:10 --:--:-- 23893^C
OUTPUT mpg123
./mpg123 -vt test.mp3
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
version 1.25.10; written and copyright by Michael Hipp and others
free software (LGPL) without any warranty but with best wishes
Decoder: x86-64 (SSE)
Trying output module: test, device: <nil></nil>
Terminal control enabled, press 'h' for listing of keys and functions.
Playing MPEG stream 1 of 1: test.mp3 ...
MPEG 1.0 L III cbr192 44100 j-s
456+000 00:11.91+00:00.00 --- 100=100 192 kb/s 627 B acc 0 clip p+0.000
[0:11] Decoding of test.mp3 finished.
Until no problem the file (test.mp3) is read without problem.
When I add the parameter to curl -H "Icy-MetaData: 1" it means add in the stream the stream (webradio) the metadata like (StreamTitle) the whole thing is generated in a file at the output (file test.mp3 ) see OUTPUT example:
curl -H "Icy-MetaData:1" -v http://stream.c9.fr/c9.mp3 > test.mp3
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 Trying 66.70.200.63...
TCP_NODELAY set
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Connected to stream.c9.fr (66.70.200.63) port 80 (#0)
GET /c9.mp3 HTTP/1.1
Host: stream.c9.fr
User-Agent: curl/7.64.1
Accept: /
Icy-MetaData:1
< HTTP/1.0 200 OK
< Server: Icecast 2.4.2
< Date: Sat, 11 May 2019 11:28:26 GMT
< Content-Type: audio/mpeg
< Cache-Control: no-cache
< Expires: Mon, 26 Jul 1997 05:00:00 GMT
< Pragma: no-cache
< Access-Control-Allow-Origin: *
< icy-br:192
< ice-audio-info: channels=2;samplerate=44100;bitrate=192
< icy-description:C9 Radio - Only Hits! - c9.fr
< icy-genre:Top40 Hits Club Pop Rock Urban
< icy-name:C9 Radio - Only Hits! - c9.fr
< icy-pub:1
< icy-url:https://www.c9.fr/
< icy-metaint:16000
<
{ [1400 bytes data]
100 254k 0 254k 0 0 28445 0 --:--:-- 0:00:09 --:--:-- 23993^C
What I can not understand is that reading with mpg123 the file test.mp3 is read with errors see OUTPUT mpg123
OUTPUT mpg123
mpg123 -vt test.mp3
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
version 1.14.4; written and copyright by Michael Hipp and others
free software (LGPL/GPL) without any warranty but with best wishes
Decoder: x86-64 (SSE)
Playing MPEG stream 1 of 1: test.mp3 ...
MPEG 1.0, Layer: III, Freq: 44100, mode: Joint-Stereo, modext: 2, BPF : 627
Channels: 2, copyright: No, original: Yes, CRC: No, emphasis: 0.
Bitrate: 192 kbit/s Extension value: 0
Frame# 24 [ 386], Time: 00:00.62 [00:10.08], RVA: off, Vol: 100(100)Note: Illegal Audio-MPEG-Header 0x69746c65 at offset 16008.
Note: Trying to resync...
Note: Skipped 65 bytes in input.
Frame# 48 [ 361], Time: 00:01.25 [00:09.43], RVA: off, Vol: 100(100)Note: Illegal Audio-MPEG-Header 0xeafffbb2 at offset 32373.
Note: Trying to resync...
Note: Skipped 1 bytes in input.
Frame# 72 [ 337], Time: 00:01.88 [00:08.80], RVA: off, Vol: 100(100)[layer3.c:454] error: big_values too large!
[layer3.c:454] error: big_values too large!
Note: Illegal Audio-MPEG-Header 0x9ffffbb2 at offset 48674.
Note: Trying to resync...
Note: Skipped 1 bytes in input.
Frame# 96 [ 313], Time: 00:02.50 [00:08.17], RVA: off, Vol: 100(100)Note: Illegal Audio-MPEG-Header 0xe9fffbb2 at offset 64349.
Note: Trying to resync...
Note: Skipped 1 bytes in input.
Frame# 120 [ 289], Time: 00:03.13 [00:07.54], RVA: off, Vol: 100(100)Note: Illegal Audio-MPEG-Header 0x79fffbb2 at offset 80650.
Note: Trying to resync...
Note: Skipped 1 bytes in input.
Frame# 152 [ 257], Time: 00:03.97 [00:06.71], RVA: off, Vol: 100(100)Note: Illegal Audio-MPEG-Header 0x0ffffbb2 at offset 96325.
Note: Trying to resync...
Note: Skipped 1 bytes in input.
Frame# 176 [ 233], Time: 00:04.59 [00:06.08], RVA: off, Vol: 100(100)Note: Illegal Audio-MPEG-Header 0x4dfffbb2 at offset 112626.
Note: Trying to resync...
Note: Skipped 1 bytes in input.
Frame# 200 [ 209], Time: 00:05.22 [00:05.45], RVA: off, Vol: 100(100)Note: Illegal Audio-MPEG-Header 0xb1fffbb2 at offset 128301.
Note: Trying to resync...
Note: Skipped 1 bytes in input.
Frame# 224 [ 185], Time: 00:05.85 [00:04.83], RVA: off, Vol: 100(100)Note: Illegal Audio-MPEG-Header 0x49fffbb2 at offset 144602.
Note: Trying to resync...
Note: Skipped 1 bytes in input.
Frame# 248 [ 161], Time: 00:06.47 [00:04.20], RVA: off, Vol: 100(100)Note: Illegal Audio-MPEG-Header 0x10fffbb0 at offset 160277.
Note: Trying to resync...
Note: Skipped 1 bytes in input.
Frame# 280 [ 129], Time: 00:07.31 [00:03.36], RVA: off, Vol: 100(100)Note: Illegal Audio-MPEG-Header 0x7ffffbb2 at offset 176578.
Note: Trying to resync...
Note: Skipped 1 bytes in input.
Frame# 304 [ 105], Time: 00:07.94 [00:02.74], RVA: off, Vol: 100(100)Note: Illegal Audio-MPEG-Header 0x41fffbb2 at offset 192252.
Note: Trying to resync...
Note: Skipped 1 bytes in input.
Frame# 328 [ 81], Time: 00:08.56 [00:02.11], RVA: off, Vol: 100(100)Note: Illegal Audio-MPEG-Header 0x88fffbb2 at offset 208554.
Note: Trying to resync...
Note: Skipped 1 bytes in input.
Frame# 352 [ 57], Time: 00:09.19 [00:01.48], RVA: off, Vol: 100(100)Note: Illegal Audio-MPEG-Header 0x41fffbb2 at offset 224228.
Note: Trying to resync...
Note: Skipped 1 bytes in input.
Frame# 376 [ 33], Time: 00:09.82 [00:00.86], RVA: off, Vol: 100(100)Note: Illegal Audio-MPEG-Header 0x0cfffbb2 at offset 240530.
Note: Trying to resync...
Note: Skipped 1 bytes in input.
Frame# 400 [ 9], Time: 00:10.44 [00:00.23], RVA: off, Vol: 100(100)Note: Illegal Audio-MPEG-Header 0x4dfffbb2 at offset 256204.
Note: Trying to resync...
Note: Skipped 1 bytes in input.
Frame# 409 [ 1], Time: 00:10.68 [00:00.02], RVA: off, Vol: 100(100)
[0:10] Decoding of test.mp3 finished.
if I put the option "Icy-MetaData: 1" I have the same problem with my streaming program of (webradio) the error and in function mpg123_decode_frame example:
err = mpg123_decode_frame(mh, &frame_offset, &audio, &done);
in the mpg123_feed function I do not have any example errors:
mpg123_feed(mh, (const unsigned char *) DataBufferMP3, Counternmemb);
is there not a way to with the option "Icy-MetaData: 1" to play the stream with (mpg123_decode_frame) without errors of messages:
Frame# 24 [ 386], Time: 00:00.62 [00:10.08], RVA: off, Vol: 100(100)Note: Illegal Audio-MPEG-Header 0x69746c65 at offset 16008.
Note: Trying to resync...
Note: Skipped 65 bytes in input.
to skip the metadata and read only mp3 streams.
thank you
Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/mpg123/bugs/278/
To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/
Related
Bugs:
#278I have some trouble parsing your last message. It has the whole thread in it without clear quoting. I guess you are trying to use sf.net via mail and it does not interact well with the top-posting in the replies?
About skipping the ICY data yourself and keep using the feeder API, this is a working program:
It gives this output:
You can omit the pipe to out123 (for listening) and redirect to a file or /dev/null instead. I hope you can work out what goes wrong in your program by comparing the logic.
Last edit: Thomas Orgis 2019-05-22
thank you for finding an alternative.
int mpg123_replace_reader_handle (mpg123_handle * mh, ssize_t () (void , void , size_t) r_read, off_t () (void , off_t, int) r_lseek, void () (void *) cleanup)
How I use these settings ("mh" ok I know, "r_read" I do not know, "r_lseek" I do not know, "cleanup" I do not know)
and where I put it in the code
Here are the parameters I use in the calling order:
mpg123_init();
mh = mpg123_new(NULL, NULL);
mpg123_open_feed(mh);
mpg123_param(mh, MPG123_ICY_INTERVAL, 16000, 0)
mpg123_feed(mh, (const unsigned char*) buffer, size * nmemb);
mpg123_decode_frame(mh, &frame_offset, &audio, &done);
Thank you
Didier
Alternatively, if you have to stay with the feeder, you'll just have to cut out the ICY block each 16000 bytes yourself here.
I tried to cut the ICY block every 16,000 bytes. it does not work he always finds the error message
Frame# 24 [ 386], Time: 00:00.62 [00:10.08], RVA: off, Vol: 100(100)Note: Illegal Audio-MPEG-Header 0x69746c65 at offset 16008.
Note: Trying to resync...
Note: Skipped 65 bytes in input.
I cut the buffer that is to say example:
unsigned char DataBufferMP3 = (unsigned char ) malloc(nmemb);
for (int i = 0; i < nmemb; i++)
{
if(CounterBuffer <= 15999)
DataBufferMP3[i] = ((const unsigned char *) buffer)[i];
Thank you
Didier
/*
mpglib: test program for libmpg123, in the style of the legacy mpglib test program
*/
mpglib is an example without streaming
we do not see how mpglib manages intervalls without streaming
Thank you
Didier
Hello.
I know, it is a old issue and I did have the same problem of the byte with error illegal entry.
And that cause a delay/click in sound very boring.
Even adding: mpg123_param(mh, MPG123_ICY_INTERVAL, 16000, 0)
Till I read this:
/ Enumeration of the parameters types that it is possible to set/get. */
enum mpg123_parms
....
MPG123_ICY_INTERVAL, /< Stream contains ICY metadata with this interval (integer).
Make sure to set this before opening a stream.*/
mpg123_param(mh, MPG123_ICY_INTERVAL, 16000, 0) must be placed BEFORE opening the stream.
Doing this, the sound is clear and no more error in console.
I have seen that Didier Castelli did the same error maybe it could help (but I agree a few to late ;-) )
Fre;D