noumanjavaid commited on
Commit
8ce9c6a
·
verified ·
1 Parent(s): 4cff2f7

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +3 -3
src/streamlit_app.py CHANGED
@@ -13,8 +13,7 @@ from dotenv import load_dotenv
13
 
14
  import cv2 # For image processing
15
  import pyaudio # For audio PLAYBACK
16
- import PIL.
17
- Image
18
 
19
  from google import genai
20
  from google.genai import types
@@ -330,7 +329,8 @@ class AudioProcessor(AudioProcessorBase):
330
  # Note: Ensure this mime_type and the actual audio data format (sample rate, channels, bit depth)
331
  # are compatible with what the Gemini Live API expects for PCM audio.
332
  mime_type = f"audio/L16;rate={frame.sample_rate};channels={frame.layout.channels}"
333
- api_data = {"data": audio_data, "mime_type": mime_type}
 
334
  try:
335
  if audio_chunks_to_gemini_q.full():
336
  try: await asyncio.wait_for(audio_chunks_to_gemini_q.get(), timeout=0.01)
 
13
 
14
  import cv2 # For image processing
15
  import pyaudio # For audio PLAYBACK
16
+ import PIL.Image
 
17
 
18
  from google import genai
19
  from google.genai import types
 
329
  # Note: Ensure this mime_type and the actual audio data format (sample rate, channels, bit depth)
330
  # are compatible with what the Gemini Live API expects for PCM audio.
331
  mime_type = f"audio/L16;rate={frame.sample_rate};channels={frame.layout.channels}"
332
+ api_data = {"data"
333
+ : audio_data, "mime_type": mime_type}
334
  try:
335
  if audio_chunks_to_gemini_q.full():
336
  try: await asyncio.wait_for(audio_chunks_to_gemini_q.get(), timeout=0.01)