INNER CODE UNIT · Python

prompt_text

bigsk1/voice-chat-ai · app/app.py:505

                    prompt_text=None,  # Will auto-transcribe if needed
                    temperature=0.8,
                    top_k=50,
                    top_p=0.95
                )
                src_path = os.path.join(output_dir, 'output.wav')
                # Spark-TTS already returns numpy array
                sf.write(src_path, wav_np, sparktts_model.sample_rate)
                print("Audio generated successfully with Spark-TTS.")
                await send_message_to_clients(json.dumps({"action": "ai_start_speaking"}))
                await play_audio(src_path)
                await send_message_to_clients(json.dumps({"action": "ai_stop_speaking"}))
            except Exception as e:
                print(f"Error during Spark-TTS audio generation: {e}")
                await send_message_to_clients(json.dumps({
                    "action": "error",
                    "message": f"Spark-TTS error: {str(e)}"
                }))

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…