User wants to control `max_session_duration` for WebSocket connections in Sarvam TTS. Setting it to 0 (no reuse) noticeably improves TTS audio quality, likely by avoiding stale session state or cached packet context on the Sarvam server side. The parameter is currently hardcoded.
### Feature Type Would make my life easier ### Feature Description Currently the WebSocket connection pool has max_session_duration hardcoded to 3600 seconds, meaning connections are aggressively reused across TTS requests. Setting this to 0 (no reuse) results in a fresh WebSocket session per request, which noticeably improves TTS audio quality (likely because stale session state or cached packet context on the Sarvam server side is avoided) ### Workarounds / Alternatives The only current workaround is reaching into a private attribute after construction: ```python tts._pool._max_session_duration = 0 ``` This is fragile and not part of the public API. ## Proposed Solution Add a max_session_duration parameter to the TTS constructor: ```python OurTTS = sarvam.TTS( target_language_code="hi-IN", model="bulbul:v3", speaker="ritu", max_session_duration=0, # fresh connection per request ) ``` And pass it through to the pool: ```python self._pool = utils.Connection