/// <summary> /// Sends metadata to a Shoutcast 2 server. /// </summary> /// <param name="Handle">The encoder Handle.</param> /// <param name="Type">The type of metadata.</param> /// <param name="Metadata">The XML metadata to send.</param> /// <returns>If successful, <see langword="true" /> is returned, else <see langword="false" /> is returned. Use <see cref="Bass.LastError" /> to get the error code.</returns> /// <exception cref="Errors.Handle"><paramref name="Handle" /> is not valid.</exception> /// <exception cref="Errors.NotAvailable">There isn't a cast set on the encoder.</exception> /// <exception cref="Errors.Unknown">Some other mystery problem!</exception> public static bool CastSendMeta(int Handle, EncodeMetaDataType Type, string Metadata) { if (string.IsNullOrEmpty(Metadata)) { return(false); } var bytes = Encoding.UTF8.GetBytes(Metadata); return(BASS_Encode_CastSendMeta(Handle, Type, bytes, bytes.Length)); }
/// <summary> /// Sends metadata to a Shoutcast 2 server. /// </summary> /// <param name="Handle">The encoder Handle.</param> /// <param name="Type">The type of metadata.</param> /// <param name="Buffer">The XML metadata as an UTF-8 encoded byte array.</param> /// <returns>If successful, <see langword="true" /> is returned, else <see langword="false" /> is returned. Use <see cref="Bass.LastError" /> to get the error code.</returns> /// <exception cref="Errors.Handle"><paramref name="Handle" /> is not valid.</exception> /// <exception cref="Errors.NotAvailable">There isn't a cast set on the encoder.</exception> /// <exception cref="Errors.Unknown">Some other mystery problem!</exception> public static bool CastSendMeta(int Handle, EncodeMetaDataType Type, byte[] Buffer) { return(BASS_Encode_CastSendMeta(Handle, Type, Buffer, Buffer.Length)); }
static extern bool BASS_Encode_CastSendMeta(int handle, EncodeMetaDataType type, byte[] data, int length);