3

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?

William
  • 255
  • 1
  • 3
  • 8
  • 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..! – user3169393 Jan 07 '14 at 22:21
  • I'm glad u asked this question because I have the same problem! – Mark Lapasa Oct 19 '16 at 18:12

1 Answers1

2

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.

William
  • 255
  • 1
  • 3
  • 8