Author Topic: BASSEnc Send custom message to icecast  (Read 342 times)

Guilain

  • Posts: 6
BASSEnc Send custom message to icecast
« on: 22 Apr '24 - 11:07 »
Hi,
I'm looking to write a custom packet, and send it synced, in the middle of audio bitsteam chunks to icecast server, fed by BASS_Encode_AAC_Start or BASS_Encode_MP3_Start, and casted by BASS_Encode_CastInit.
Is there any way to do that ?
Thanks,
G.

Ian @ un4seen

  • Administrator
  • Posts: 26146
Re: BASSEnc Send custom message to icecast
« Reply #1 on: 22 Apr '24 - 17:13 »
I don't think Icecast (or Shoutcast which it will be emulating for MP3/AAC) allows arbitrary data in amongst a stream, but you could perhaps use BASS_Encode_CastSetTitle to send your message and then use a BASS_SYNC_META sync and BASS_ChannelGetTags (with BASS_TAG_META) to receive it in the client. Note that's a string, so mustn't contain nulls, and you should use encoding (eg. hex or base64) if yours may. Also note the length is limited to around 4050 characters.

Guilain

  • Posts: 6
Re: BASSEnc Send custom message to icecast
« Reply #2 on: 23 Apr '24 - 09:16 »
Thanks Ian,
I didn't mentionned that it's a special Icecast server who need some extra command packets inside the stream.
Is BASS_Encode_CastSetTitle send a packet inside the stream between audio chunks ? I just need to send.

Guilain

  • Posts: 6
Re: BASSEnc Send custom message to icecast
« Reply #3 on: 23 Apr '24 - 09:27 »
I can see that BASS_Encode_CastSetTitle  seems to be a GET in parallel so, I cannot use it.
I suppose I've to write my own custom Icecast source class...
Thanks,
G.

Ian @ un4seen

  • Administrator
  • Posts: 26146
Re: BASSEnc Send custom message to icecast
« Reply #4 on: 23 Apr '24 - 12:53 »
The metadata is indeed sent to the Icecast server in a separate connection, but the server will then insert it into the audio stream that's sent to the clients. If you want the source to use the same connection for audio and metadata then Shoutcast2 has that, and it also allows custom data formats via BASS_Encode_CastSendMeta. If you specifically need it with a customised Icecast server then you probably will need a custom source for that too.