0

I have VLC installed on my raspberry pi 3. I want to be able to run a python file that opens a mp3 sound file (my_sound.mp3) and plays the sound. The closest that I got is:

import os
import subprocess
os.system("/usr/bin/cvlc")

Rasp is running ubuntu.

James KM
  • 69
  • 8
  • Possible duplicate of [Playing mp3 song on python](https://stackoverflow.com/questions/20021457/playing-mp3-song-on-python) – Martin Jan 18 '19 at 15:19
  • @Martin: fyi, your actions [are being discussed](https://meta.stackoverflow.com/questions/379138/told-i-would-only-get-correct-answer-if-i-accepted-incorrect-one) – Hovercraft Full Of Eels Jan 19 '19 at 13:15

1 Answers1

-2

Well, I fixed the issue:

apt-get install mpg321


import os
os.system('mpg321 mysoung.mp3 &')

if you want to loop use the following key:

os.system('mpg321 -l 0 mysoung.mp3 &')
James KM
  • 69
  • 8