INNER CODE UNIT · Python
samples
rohitg00/awesome-ai-apps · multimodal-apps/hedra-live-avatars-demo/hedra-avatar-backend/app/main.py:201
samples = int(sample_rate * duration)
audio_data = np.zeros(samples, dtype=np.int16)
# Create WAV file in memory
buffer = io.BytesIO()
with wave.open(buffer, 'wb') as wav_file:
wav_file.setnchannels(1) # Mono
wav_file.setsampwidth(2) # 16-bit
wav_file.setframerate(sample_rate)
wav_file.writeframes(audio_data.tobytes())
return buffer.getvalue()
# API Routes
@app.get("/")
async def root():
return {
"message": "AI Companion Studio API",