Class ProcessConsumerTransportsAudio

Processes consumer transports for audio streams by pausing and resuming them based on their current state and the provided streams.

This method checks the state of each audio consumer transport and either pauses or resumes it depending on the presence of its producer ID in the provided list of streams. It uses a sleep function to introduce a delay between the pause and resume operations to ensure smooth transitions.

The options for processing consumer transports.

The list of consumer transports to process.

The list of local streams to check against.

Additional parameters for processing.

A function to pause execution for a specified duration.

A promise that resolves when the processing is complete.

Will throw an error if there is an issue processing the consumer transports.

const options = {
consumerTransports: [,
lStreams: [],
parameters: {
sleep: async ({ ms }) => new Promise(resolve => setTimeout(resolve, ms)),
},
};

await processConsumerTransportsAudio(options);

Constructors

Methods

  • Processes consumer transports for audio streams by pausing and resuming them based on their current state and the provided streams.

    Parameters

    Returns Promise<void>

    A promise that resolves when the processing is complete.

    Will throw an error if there is an issue processing the consumer transports.