Package ai.rev.speechtotext
Class StreamContentType
- java.lang.Object
-
- ai.rev.speechtotext.StreamContentType
-
public class StreamContentType extends Object
The StreamContentType describes the format of the audio being sent over the WebSocket.
-
-
Constructor Summary
Constructors Constructor Description StreamContentType()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringbuildContentString()Returns the content string compiled from theStreamContentTypeproperties to be used in the query parameter for the request to the /stream endpoint.IntegergetChannels()Returns the number of channels.StringgetContentType()Returns the content type.StringgetFormat()Returns the format of the audio samples.StringgetLayout()Returns the channel layout.IntegergetRate()Returns the audio sample rate.voidsetChannels(Integer channels)Specifies the number of audio channels that the audio samples contain.voidsetContentType(String contentType)Specifies the content type of the audio.voidsetFormat(String format)Specifies the format of the audio samples.voidsetLayout(String layout)Specifies the layout of channels within the buffer.voidsetRate(Integer rate)Specifies the sample rate of the audio.
-
-
-
Method Detail
-
getContentType
public String getContentType()
Returns the content type.- Returns:
- The content type.
-
setContentType
public void setContentType(String contentType)
Specifies the content type of the audio.- Parameters:
contentType- The type of audio.- See Also:
- https://www.rev.ai/docs/streaming#section/WebSocket-Endpoint/Content-Type
-
getLayout
public String getLayout()
Returns the channel layout.- Returns:
- The channel layout.
-
setLayout
public void setLayout(String layout)
Specifies the layout of channels within the buffer.- Parameters:
layout- The channel layout.- See Also:
- https://www.rev.ai/docs/streaming#section/WebSocket-Endpoint/Content-Type
-
getRate
public Integer getRate()
Returns the audio sample rate.- Returns:
- The audio sample rate.
-
setRate
public void setRate(Integer rate)
Specifies the sample rate of the audio.- Parameters:
rate- The sample rate of the audio.- See Also:
- https://www.rev.ai/docs/streaming#section/WebSocket-Endpoint/Content-Type
-
getFormat
public String getFormat()
Returns the format of the audio samples.- Returns:
- The format of the audio samples.
-
setFormat
public void setFormat(String format)
Specifies the format of the audio samples.- Parameters:
format- The format of the audio samples.- See Also:
- https://www.rev.ai/docs/streaming#section/WebSocket-Endpoint/Content-Type, Valid formats
-
getChannels
public Integer getChannels()
Returns the number of channels.- Returns:
- The number of channels.
-
setChannels
public void setChannels(Integer channels)
Specifies the number of audio channels that the audio samples contain.- Parameters:
channels- the number of audio channels in the audio.- See Also:
- https://www.rev.ai/docs/streaming#section/WebSocket-Endpoint/Content-Type
-
buildContentString
public String buildContentString()
Returns the content string compiled from theStreamContentTypeproperties to be used in the query parameter for the request to the /stream endpoint.- Returns:
- The content string used as the query parameter.
-
-