BASSEnc Send custom message to icecast

Started by Guilain,

Guilain

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

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

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

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

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.