1212from typing import Optional , Union
1313
1414from fishjam import AgentOutputOptions
15+ from fishjam .agent import OutgoingAudioTrackOptions
16+ from fishjam .events import TrackEncoding
1517from fishjam .version import get_version
1618
1719
@@ -79,7 +81,7 @@ def create_client(
7981 def GEMINI_INPUT_AUDIO_SETTINGS (self ) -> AgentOutputOptions :
8082 """Audio configuration required for Gemini input.
8183
82- Gemini requires PCM16 audio at 16,000 Hz for correct processing .
84+ Gemini consumes PCM16 audio at 16,000 Hz.
8385
8486 Returns:
8587 AgentOutputOptions: Agent options compatible with the Gemini Live API.
@@ -89,6 +91,21 @@ def GEMINI_INPUT_AUDIO_SETTINGS(self) -> AgentOutputOptions:
8991 audio_sample_rate = 16_000 ,
9092 )
9193
94+ @property
95+ def GEMINI_OUTPUT_AUDIO_SETTINGS (self ) -> OutgoingAudioTrackOptions :
96+ """Audio configuration for an agent's output track.
97+
98+ Gemini produces PCM16 audio at 24,000 Hz.
99+
100+ Returns:
101+ OutgoingAudioTrackOptions: Track options compatible with the Gemini Live API
102+ """
103+ return OutgoingAudioTrackOptions (
104+ encoding = TrackEncoding .TRACK_ENCODING_PCM16 ,
105+ sample_rate = 24_000 ,
106+ channels = 1 ,
107+ )
108+
92109 @property
93110 def GEMINI_AUDIO_MIME_TYPE (self ) -> str :
94111 """The mime type for Gemini audio input."""
0 commit comments