class ConnectionMessage

ConnectionMessage represents implementation specific messages sent to and received from the speech service. These messages are provided for debugging purposes and should not be used for production use cases with the Azure Cognitive Services Speech Service. Messages sent to and received from the Speech Service are subject to change without notice. This includes message contents, headers, payloads, ordering, etc. Added in version 1.10.0.

Members

Properties

Syntax: public PropertyCollection & Properties;

A collection of properties and their values defined for this ConnectionMessage. Message headers can be accessed via this collection (e.g. "Content-Type").

ConnectionMessage

Syntax: public inline explicit ConnectionMessage ( SPXCONNECTIONMESSAGEHANDLE hcm );

Constructor.

Parameters

  • hcm Event handle.

~ConnectionMessage

Syntax: public inline virtual ~ConnectionMessage ( );

Destructor.

GetPath

Syntax: public inline std::string GetPath ( ) const;

Gets the message path.

Returns

An std::string containing the message path.

IsTextMessage

Syntax: public inline bool IsTextMessage ( ) const;

Checks to see if the ConnectionMessage is a text message. See also IsBinaryMessage().

Returns

A bool indicated if the message payload is text.

IsBinaryMessage

Syntax: public inline bool IsBinaryMessage ( ) const;

Checks to see if the ConnectionMessage is a binary message. See also GetBinaryMessage().

Returns

A bool indicated if the message payload is binary.

GetTextMessage

Syntax: public inline std::string GetTextMessage ( ) const;

Gets the text message payload. Typically the text message content-type is application/json. To determine other content-types use Properties.GetProperty("Content-Type").

Returns

An std::string containing the text message.

GetBinaryMessage

Syntax: public inline std::vector< uint8_t > GetBinaryMessage ( ) const;

Gets the binary message payload.

Returns

An std::vector<uint8_t> containing the binary message.