I copy and pasted the node.js demo code but it's just running then exiting the process..?
An introduction to getting transcription data from live streaming audio in real time.
1 messages · Page 1 of 1 (latest)
I copy and pasted the node.js demo code but it's just running then exiting the process..?
An introduction to getting transcription data from live streaming audio in real time.
Hi @ornate token. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
Hey there! This channel allows you to ask Kapa.ai for assistance. But it looks like you haven't connected your Discord profile to your Deepgram account yet. You can do so at https://community.deepgram.com - by doing so, you'll be able to ask questions in #1115960287183511643 if you need human assistance!
Deepgram’s community offers tons of resources to support you on your voice AI journey
I'm sorry you're having trouble with the demo code. Based on the knowledge sources, there are a few common reasons why Deepgram demo code might run and then exit immediately:
Missing or Incorrect API Key: Make sure you have set your Deepgram API key correctly. Many demos require you to set an environment variable or directly insert your API key in the code. If the key is missing or invalid, the process may exit without clear errors.
No Audio Input or File: Some demos expect an audio file or stream as input. If the code is not provided with a valid audio source, it may finish execution without doing anything noticeable.
Async Code Not Awaited: In Node.js and Python, if you use async functions but don't await them or don't keep the process alive, the script may exit before any asynchronous work completes. For example, in Python, you should wrap your main logic in an async function and use asyncio.run(main()) to ensure it runs properly. Similarly, in Node.js, make sure to await any promises or keep the process alive until all work is done. See this example for looping through files in Python, which uses asyncio.run() to keep the process running until all files are processed Looping through list of podcast episodes using Python.
No Event Listeners or Output: If the demo is event-driven (e.g., using WebSockets), ensure you have set up listeners for events like on('message'), on('data'), or similar, and that you are logging or handling the output.
.env-example to .env and fill in your settings (like API key, port, etc.) before running. If these are missing, the app may exit immediately Transcribe Meetings in Realtime.What to do:
If you can share which specific demo code you are using (e.g., Node.js, Python, TTS, STT, etc.), I can provide more targeted troubleshooting steps. If you are using a code sample from the Deepgram docs or GitHub, make sure to follow all setup steps, including installing dependencies and configuring environment variables.