Thanks — you're building a telephony app in Python and want to set input gain for users.
Two quick clarifying questions so I can give the right guidance:
1. Are you using LiveKit’s Python server SDK only, or a client SDK in Python (or another audio library) to capture/send audio?
2. Do you need to change the microphone gain before sending (client-side) or adjust gain for incoming streams on the receiver side (mix/relay)?
What I can say now:
• The LiveKit server SDKs do not provide remote control of a participant’s microphone hardware gain. Client-side audio must be adjusted where the audio is captured or before it’s encoded and sent.
• For a Python telephony app you can implement gain control by processing audio frames locally (before sending) or on received frames (before playback). Typical approaches:
◦ Capture raw PCM, multiply samples by a gain factor, clamp to avoid clipping, then encode/send.
◦ Apply a simple AGC (automatic gain control) algorithm or use an audio library that offers AGC or gain control.
◦ If you use a telephony/media framework (e.g., pjsip/pjmedia, Asterisk, FreeSWITCH, or a WebRTC stack), check whether that framework exposes input gain/AGC settings; otherwise insert a processing hook to adjust samples.
If you tell me which Python audio/telephony library or client stack you use, I’ll give a short code example for applying a gain multiplier to PCM frames or point to the exact setting to change.