Questions tagged [python-playsound]

A single-function module for playing sounds according to a file-path or a URL.

PyPi page: https://pypi.org/project/playsound/

114 questions
0
votes
1 answer

How to play sound after printing to the screen?

I am trying to write a program that plays the Morse code sound while showing the Morse code. The problem that I have is sound plays before showing the Morse code in the program. The program has a UI based on tkinter: for item in self.morse_code: …
0
votes
1 answer

Python3 Playsound Tkinter code not running in order expected

I want to call a function (trigger) that will hide one image, show another image and play a sound. The sound has to play last as it lasts for several seconds locking everything up. When I call the function my alarm sound plays for several seconds…
dogfood
  • 3
  • 1
0
votes
2 answers

Pyinstaller Error: ModuleNotFoundError: No module name 'playsound'

I'm running pyinstaller from cmd to create an exe from a script I wrote in a Pycharm Venv. I'm using the line: pyinstaller--onefile main.py When trying to run my exe I get this error: File "main.py, line 2, in from playsound…
0
votes
1 answer

How can I play a sound in python using a mac?

How can I play a sound in Python? I tried using playsound and saying playsound('explosion.mp3') but I get an error saying that: raise IOError('Unable to load sound named: ' + sound) OSError: Unable to load sound named:…
0
votes
3 answers

How to use playsound Asynchronously?

I know that if I do: playsound("filepath.mp3", block=False) that it is supposed to run asynchronously. But when I try it, the mp3 file doesn't play, when I set it to True (default), the mp3 file plays - but the program halts for the mp3 file to…
Ledrake
  • 114
  • 10
0
votes
1 answer

"Namespace Gst not available" error when using playsound module in Raspbian os

I recently came across the playsound module and I tried my Python IDE in my Raspbian os it's giving me some error: from playsound import playsound playsound('/home/pi/mu_code/music.mp3') This code is getting me error: Traceback (most recent call…
0
votes
1 answer

playsound says file not found when audio file is in same directory

My code is an auto notification system. The audio file I used with my code s in the same directory as the Python file. But when I run the code, playsound says file not found. import schedule import time from playsound import playsound #define…
Michael I.
  • 9
  • 1
  • 4
0
votes
2 answers

Not able to play audio file in python

I am trying to play the audio files using Python. Below is my code: from pygame import mixer from time import sleep from playsound import playsound mixer.init() # mixer.music.load("test1.mp3") # mixer.music.play() #…
sanketh s
  • 345
  • 1
  • 5
  • 14
0
votes
1 answer

Error python when use playsound + os path

i use this line for my game playsound(os.path.join(os.path.dirname(__file__) , 'asset', C1 + '.mp3')) it's work well on linux but on windows i get output: raise PlaysoundException(exceptionMessage) playsound.PlaysoundException: Error 275 for…
Blaplafla
  • 9
  • 3
0
votes
3 answers

How can I interrupt pyttsx3 and playsound?

I'm trying to make an assistant but when the user wants to play a song, it keeps playing it until finishes. I want it to stop when the user presses a key. It is same for the engine.say(), too. I couldn't find a way to interrupt actions on their…
0
votes
1 answer

Python Playsound UnicodeDecodeError while playing sound

I wrote a code that works perfectly on Ubuntu but not working on Windows. Here's the code : from playsound import playsound playsound("sound") And the error : Traceback (most recent call last): File "test.py", line 3, in
SashimiDélicieux
  • 476
  • 1
  • 5
  • 17
0
votes
1 answer

ImportError no module named 'playsound'

I did pip install playsound Downloading/unpacking playsound Downloading playsound-1.2.2-py2.py3-none-any.whl Installing collected packages: playsound Successfully installed playsound Cleaning up... and it installed playsound (at least is said…
cli
  • 162
  • 2
  • 10
0
votes
1 answer

How to make vscode work with playsound module?

I have this very simple test code: from playsound import playsound playsound('alarmsound.wav') alarmsound.wav is a file in the same directory. when I run it in a terminal, it works fine. But when I run it in VSCode, it blows up with the following…
lucafossen
  • 9
  • 1
  • 3
0
votes
0 answers

unable to open mixer in python kivy audio

I am trying to play an mp3 file with Python's kivy. My code is: from kivy.core.audio import SoundLoader sound = SoundLoader.load('s.mp3') if sound: print("Sound found at %s" % sound.source) print("Sound is %.3f seconds" % sound.length) …
Mohan Raj
  • 167
  • 12
0
votes
1 answer

What are the differences between a WAV file (.wav) and a WAVE audio file (.wave)?

I am trying to use the PyAudio library to record guitar audio through my USB audio interface in a python project. When I use audio applications such as Audacity to save the audio I get a WAV (.wav) file which can be played using apps such as Groove…
Caolan
  • 11
  • 3