audio.mdx 746 B

12345678910111213141516171819202122232425
  1. ---
  2. title: "🎤 Audio"
  3. ---
  4. To use an audio as data source, just add `data_type` as `audio` and pass in the path of the audio (local or hosted).
  5. We use [Deepgram](https://developers.deepgram.com/docs/introduction) to transcribe the audiot to text, and then use the generated text as the data source.
  6. You would require an Deepgram API key which is available [here](https://console.deepgram.com/signup?jump=keys) to use this feature.
  7. ### Without customization
  8. ```python
  9. import os
  10. from embedchain import App
  11. os.environ["DEEPGRAM_API_KEY"] = "153xxx"
  12. app = App()
  13. app.add("introduction.wav", data_type="audio")
  14. response = app.query("What is my name and how old am I?")
  15. print(response)
  16. # Answer: Your name is Dave and you are 21 years old.
  17. ```