AudioStream#

class langchain_community.utilities.nvidia_riva.AudioStream(maxsize: int = 0)[source]#

A message containing streaming audio.

Initialize the queue.

Attributes

complete

Indicate if the audio stream has hungup and been processed.

empty

Indicate in the input stream buffer is empty.

hungup

Indicate if the audio stream has hungup.

running

Indicate if the ASR stream is running.

Methods

__init__([maxsize])

Initialize the queue.

aclose([timeout])

Async send the hangup signal.

aput(item[,ย timeout])

Async put a new item into the queue.

close([timeout])

Send the hangup signal.

put(item[,ย timeout])

Put a new item into the queue.

register(responses)

Drain the responses from the provided iterator and put them into a queue.

Parameters:

maxsize (int)

__init__(maxsize: int = 0) โ†’ None[source]#

Initialize the queue.

Parameters:

maxsize (int)

Return type:

None

async aclose(timeout: int | None = None) โ†’ None[source]#

Async send the hangup signal.

Parameters:

timeout (int | None)

Return type:

None

async aput(item: bytes | SentinelT, timeout: int | None = None) โ†’ None[source]#

Async put a new item into the queue.

Parameters:
  • item (bytes | SentinelT)

  • timeout (int | None)

Return type:

None

close(timeout: int | None = None) โ†’ None[source]#

Send the hangup signal.

Parameters:

timeout (int | None)

Return type:

None

put(item: bytes | SentinelT, timeout: int | None = None) โ†’ None[source]#

Put a new item into the queue.

Parameters:
  • item (bytes | SentinelT)

  • timeout (int | None)

Return type:

None

register(responses: Iterator[rasr.StreamingRecognizeResponse]) โ†’ None[source]#

Drain the responses from the provided iterator and put them into a queue.

Parameters:

responses (Iterator[rasr.StreamingRecognizeResponse])

Return type:

None

Examples using AudioStream