Skip to content

Instantly share code, notes, and snippets.

View hustlzp's full-sized avatar
🎯
Focusing

Zhipeng Liu hustlzp

🎯
Focusing
  • Wuhan, China
View GitHub Profile
@Ga68
Ga68 / stream_openai_response_audio.py
Last active March 18, 2026 04:30
Streams a ChatGPT text-response into a streaming audio-response.
# pip install openai pyaudio python-dotenv
import queue
import threading
from functools import reduce
from typing import Callable, Generator
import openai
import pyaudio
from dotenv import load_dotenv