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 fix " Error 263 for command: close " error related to Playsound in Python

I was trying to code a voice assistant with the help of an online tutorial. When I tried to run the code, I kept kept getting an error message saying: Error 263 for command: close voice.mp3 The specified device is not open or is not…
0
votes
2 answers

Error 259 on python playsound() unable to sound

I Saw this question here. But my file is already in wav. My code is a timer which plays sound after timer ends using threading. It wasn't working there, then I tried it in different file which just had the file and library: from playsound import…
Pratyush Arora
  • 137
  • 1
  • 11
0
votes
1 answer

Turtle crashes while playing music with playsound2

I have simple python turtle code which works fine, but when I add music, music plays, but turtle program crashes. What are the fixes for that? Here is my code: import turtle import playsound2 t =…
Karalius32
  • 103
  • 1
  • 6
0
votes
1 answer

playsound error: raise IOError('Unable to load sound named: ' + sound) on MacOS

I want to add some sound using playsound, and it worked for a while with no issues. But when I tried to run the code today, it suddenly gave me this error. There are no spaces in the file names. MacOS Big Sur 11.2.2 Python 3.9.6 from playsound…
0
votes
1 answer

Error "Cannot specify extra characters after a string enclosed in quotation marks." while using module Playsound

So basically this my code: from playsound import playsound playsound('C:\\Users\\arnavb\\Desktop\\Python\\Lecture1\\song.mp3') And the error I get is: PS C:\Users\arnavb\Desktop\Python> &…
Snake
  • 9
  • 1
  • 2
0
votes
1 answer

I need a way to stop a function from running at the push of a button

I've been working on this for hours, and I've tried everything from break in an if statement to making an index variable. I can't seem to find a way to stop the sound/music from playing. My goal is to press 'Q' and stop the function and while loop…
GreenyPM
  • 19
  • 4
0
votes
1 answer

tkinter window behaves weirdly and stops responding

I have developed a code that allows me do set an alarm clock which can play sound effect: import time import tkinter as tk import playsound window = tk.Tk() window.title('Alarm clock') #where the problem lies def submit(): …
caterNaf
  • 13
  • 3
0
votes
1 answer

How do I make a QPushButton play a sound at the same time as it adds a text to my QLineEdit?

I'm running PyQt6. I have a QMainWindow with one QPushButton and QLineEdit in a widget. I want to play a sound every time I click the button, and simuatenously it adds a text to my line edit. I used playsound to achieve this effect, but there's a…
JA23Z
  • 25
  • 5
0
votes
1 answer

Loop fail in Text to speech in python

The program given below is working properly but the looping portion is not functioning properly. This is the error message: PermissionError: [Errno 13] Permission denied: 'TALK.mp3'. The program only works for first time and when I reset it, no…
RarKru
  • 3
  • 2
0
votes
1 answer

Is Playsound able to play two sounds at the same time?

When you press e it will play the sound, which is fine. But when you try to press it while the sound is active it waits until the sound is done to play it again. I need the sounds to be played at the same time. import tkinter from playsound import…
Lloyd
  • 95
  • 1
  • 8
0
votes
2 answers

Ubuntu Python Playsound error 'NoneType' object has no attribute 'props'

I can't use the playsound on Linux for some reason, I tried: sudo apt install gstreamer1.0-gtk3 But still not working. The code is pretty simple: import os import time import playsound import speech_recognition as sr from gtts import gTTS def…
0
votes
1 answer

Play sound and count time simultaneously

I have the following function that is part of a stopwatch program I am writing, and It will count down from a given time but for that last 5, it will play an audio clip. Basically, the function should count down from 5 at 1 second intervals.…
jon
  • 349
  • 3
  • 4
  • 20
0
votes
2 answers

Import Error: cannot import name 'playsound' from 'playsound'

I am trying to set up my Raspberry Pi Zero to play a sound through a pimoroni audio board. I am trying to use playsound but keep getting the message "Import Error: cannot import name 'playsound' from 'playsound'". My program is a simple one using…
JohnW
  • 9
  • 3
0
votes
1 answer

How to access files in subfolder independent of system?

I'd like to gather all .mp3 file paths in a folder (MP3) and assign them to keys in a dictionary, so my program works regardless of the system filepath (currently, filepaths are hardcoded, meaning the program only works on my own PC). Here's the…
user14989165
0
votes
3 answers

Regarding playsound module

Does the playsound module work in Python 3.9.1? When I write the command: from playsound import playsound playsound('C:\\Users\\acer\\Desktop\\FOLDER\\Programming\\Python\\01_project\\Bella Ciao.mp3') it doesn't run and shows the error message A…
Choco-Lava
  • 29
  • 3