Search code examples
djangoherokuspeech-recognitionpyaudio

Deploy Django app using Pyaudio library to Heroku


I built a Django app for speech recognition, the app uses the user's microphone to record audio then convert it to text. It works well locally, but when I try to deploy it in Heroku it giving an error that Pyaudio can not install and command 'gcc' failed with exit status 1.

I am using Python 3.6 and Windows 7. How can I deploy this application to Heroku?


Solution

  • the app uses the user's microphone to record audio then convert it to text

    This won't work on Heroku even if you manage to install Pyaudio.

    Python code runs on the server, not in the browser. If you try to record audio using Pyaudio it will try to record audio in some data centre somewhere on Amazon Web Services. This appears to work locally because in development your server and client are running on the same machine.

    If you want to record audio from your users you'll need to do it in JavaScript.