Search code examples
pythonlinuxamazon-web-servicesaws-cloud9

playing a mp3 in AWS cloud9


Hello I am trying to play sound files via a Python script on Amazon AWS Cloud9. If I upload the file I can play it by double-clicking on it. I tried installing playsound library but I get a missing gi library error when I try to use it. Does anyone know how I can play a mp3 with a Python script in AWS cloud9? example and error


Solution

  • The "remote desktop" layer that Cloud9 provides is not intended to be a full remote-control desktop. The Python script is executing on a remote Amazon EC2 instance, which does not have access to the sound hardware on your own computer.

    If the Python script is a back-end program (eg using Flask) that is providing a UI through a web browser, then it could provide the sound file to your application's web page and the browser on your own computer could then play the sound file (much like YouTube works).

    Otherwise, your only option is to 'download' the sound file and then play it on your own computer.