For the project I'm working on I have a python script that accepts some serial input and plays sounds depending on the input. I have the script set up and it works just fine when I run it from within the GUI. If I log out of the GUI and try to run the script from the command line though the script executes just fine but my sounds don't play. I just get a momentary static click. I can tell the script is running because I have it printing debug code and the print's work just fine.

I want this script to execute when the Raspberry Pi is turned on so per this Running a Python script at startup I was going to add a line to /etc/rc.local to run the script.

If there is some reason the sounds simply won't play until the GUI starts up how would I set it up to load the GUI and then execute the script on startup without any user input?

  • Thank you for that. I'm having the same problem: if I name the file "02.wav" I get a very light click (the file is in the current working directory). If I name the full file path I get a louder click - but still no sound..! Commented Jan 7, 2014 at 22:21
  • I'm glad u asked this question because I have the same problem! Commented Oct 19, 2016 at 18:12

1 Answer 1


Turns out it was file path naming. If I have the command line test to the root directory it doesn't work but if I "cd Desktop/containingFolder" then the sounds play. I'll play with how I have the files set up in the python script so it will work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.