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
Asked
Active
Viewed 190 times
-1
-
Cloud9 is a web front-end for a development environment. What do you mean by "play sound files" -- do you mean that your Python program should play a sound file at a particular time, or are you referring to the ability to point to a sound file in your directory structure and play it within the Cloud9 console? – John Rotenstein Dec 12 '20 at 02:09
-
I am self taught and don't know exactly how to say what I am trying to do I guess. I have a mp3 in my directory structure. I would like to play it from a Python script that I execute through the console. – Rocco J Pietrofesa Dec 15 '20 at 15:07
1 Answers
0
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.

John Rotenstein
- 241,921
- 22
- 380
- 470