MediaSFU React Native
    Preparing search index...

    Variable connectSendTransportAudioConst

    connectSendTransportAudio: ConnectSendTransportAudioType = ...

    Connects the send transport for audio by producing audio data and updating the audio producer and producer transport objects.

    If the primary connection fails, it attempts to connect using the local transport via a separate function.

    The options for connecting the send transport.

    The audio parameters.

    The parameters required for connecting the transport.

    The audio producer object.

    The producer transport object.

    The local audio producer object.

    The local producer transport object.

    The function to update the audio producer object.

    The function to update the producer transport object.

    The function to update the local audio producer object.

    The function to update the local producer transport object.

    The function to update the audio level.

    A promise that resolves when the connection is established.

    const options = {
    audioParams: { codec: 'opus', maxBitrate: 128000 },
    parameters: {
    audioProducer: null,
    producerTransport: transport,
    localAudioProducer: null,
    localProducerTransport: localTransport,
    updateAudioProducer: (producer) => console.log('Updated producer:', producer),
    updateProducerTransport: (transport) => console.log('Updated transport:', transport),
    updateLocalAudioProducer: (localProducer) => console.log('Updated local producer:', localProducer),
    updateLocalProducerTransport: (localTransport) => console.log('Updated local transport:', localTransport),
    updateAudioLevel: (level) => console.log('Updated audio level:', level),
    },
    };

    connectSendTransportAudio(options)
    .then(() => console.log('Audio transport connected successfully'))
    .catch((error) => console.error('Error connecting audio transport:', error));