Call Totem on Sound File in Python?

Call Totem on Sound File in Python?

Im trying to use the python Popen function to play a sound file. However I cant find the file location for totem video player (default ubuntu video player). This is my code so far:

subprocess.Popen(['???','home/######/Desktop/python/programsIUse/alarm.wav'], shell=True)
0

1 Answer

This works for me with the sound file 'test.mp3' in the same directory as the python script.

import subprocess

filename = 'test.mp3'
totem = subprocess.Popen (['totem', filename])
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Robert Thorne
Author

Robert Thorne

Robert Thorne covers electric vehicle innovations, autonomous driving systems, global mobility trends, and automotive engineering developments.