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
2
votes
1 answer

Playsound only plays the mp3 file once and then gives the error "Permission Denied"

I am using Playsound and gtts in Spyder IDE which creates an mp3 file and then plays it. import gtts from playsound import playsound #pass text to gTTS object # make request to google to get synthesis english = gtts.gTTS("Hello world") #retrieved…
SamaSamrin
  • 79
  • 2
  • 11
2
votes
1 answer

How to play music and print text at the same time?

I want to make this cool program that plays music while listing my life goals. I can't get the music to play while the text prints. How can I do this? from playsound import playsound import time print('My life goals…
user13918690
2
votes
2 answers

Why do I have "'utf-8' codec can't decode byte 0xc4 in position 0: invalid continuation byte " problem and how do I solve it?

I am trying to run the simple code, to play the wav sound with playsound (I found this way of sound playing on some website): from playsound import playsound playsound("Piano.wav") and when I run it, I get error: Traceback (most recent call…
Ivan Elagin
  • 21
  • 1
  • 3
2
votes
1 answer

Whenever I use the "playsound" to play sound in the background the rest of my game does not load

I decided to use playsound() to add a background sound in my program. However when I run the program with playsound, the actual game does not load until the song is finished: from playsound import playsound #type 'pip install playsound' in command…
Forgiven1
  • 21
  • 1
  • 3
1
vote
1 answer

Python Playsound not playing any sound when compiled into an .exe file

I'm trying to create a digital soundboard that can play object-defined sounds using tkinter and the playsound module. When I'm testing it via VS code, it works without any problems. But after I compile it into an exe, the app works but there's no…
Koshi
  • 31
  • 4
1
vote
0 answers

I want to play a sound while the countdown is running

I have a code which plays sound and a timer that decreases overtime but the problem is I don't know how to play the sound while the timer counts down. seconds = 10 for i in range(seconds): print(str(seconds-i) + " seconds remaining \n") …
stop
  • 29
  • 1
1
vote
1 answer

Got the error:UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe3 in position 1: invalid continuation byte, playsound

I was making a program that plays a song from playsound but I got the error:"UnicodeDecodeError:'t decode byte 0xe3 at position 1: invalid continuation byte" What to do to play the song. This was my code: from playsound import…
1
vote
2 answers

Getting an AssertionError when I use the multiprocessing module

The relevant code is actually from a separate thread. Here it is anyway import multiprocessing from playsound import playsound p = multiprocessing.Process(target=playsound, args=("file.mp3",)) p.start() input("press ENTER to stop…
soy-ish
  • 35
  • 4
1
vote
0 answers

Playsound issue: Command returned non-zero exit status 1

I have a method that I found online. The purpose of the code is for python to say words. Code for the method is below: def respond(output): num=0 print(output) num += 1 response=gTTS(text=output, lang='en') file = str(num)+".mp3" …
Epoch
  • 29
  • 2
1
vote
0 answers

Python merge audio tracks to play at the same time

I am working on music software that uses individual audio files for each note in the scale. I use the playsound module to then play these notes in the sequence constructed by the user. This works fine, but problems arise when I try and play multiple…
Gamaray
  • 68
  • 1
  • 8
1
vote
0 answers

Cx_freeze exe file opening and closing made with playsound

Every time I open it, I see a cmd window for a second and then it closes. I also have a rick roll audio file called sound.mp3. Setup.py code: import sys from cx_Freeze import setup, Executable packages = ["playsound", "os", "time",…
1
vote
0 answers

Cant play mp3 file by python in vitual env

I tried to add a beep to my code to remind the change of data. so I build a sound module using playsound and Play_mp3. It works well separately, but when called in the main function, it reported: Error 259 for command: play…
Leo_Liu
  • 37
  • 5
1
vote
4 answers

What is the error in the code for this playsound module even though the syntax is same as on official site?

I have checked path variables too everything works fine for other functions but it is showing error for this module only. Code: from playsound import playsound playsound('E://PYTHON//Music.mp3') The following is the error: PS C:\Users\HP> &…
user15915509
1
vote
1 answer

how to terminate a child process mid-way using multiprocessing

Python 3.8 OS windows 10 I'm trying to create an alarm with a GUI. Basically, when a condition is met (current time == set time) a widget must pop up with two buttons: Cancel, and Run this other code. if I press any of the buttons the alarm should…
1
vote
1 answer

Mouse Freezes/Very Laggy when using pynput and playsound module in python

from playsound import playsound from pynput import mouse def on_click(x, y, button, pressed): if pressed: print("clicked") playsound("clicking.wav") if not pressed: …
chids
  • 25
  • 4