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

I'm trying to make an alarm clock (from a tutorial) in Python, Playsound isn't activiting sound

I'm trying to make an alarm clock, and it works for the most part. But I installed playsound so I could make it play music when it goes off as an alarm clock should. I'm not quite sure how to use paths and even when I place the .wav in the folder…
SebSebSeb
  • 9
  • 3
-1
votes
1 answer

I am getting error on import the playsound module even after pip install playsound

This is the code: from datetime import datetime from playsound import playsound alarm_time = input("Enter the time of alarm to be set:HH:MM:SS\n") alarm_hour=alarm_time[0:2] alarm_minute=alarm_time[3:5] alarm_seconds=alarm_time[6:8] alarm_period =…
-1
votes
1 answer

Playing a a song while program executes

I'd like to know what code will allow me to play an audio track (mp3) while my game program executes. Once the song finishes I would like it to play over and over till the player is done with the game.
CCryda
  • 1
  • 3
-1
votes
1 answer

how to get a specific file(sound file) when the file name is called by a variable in using Pyglet

When using module pyglet, giving the name of mp3 explicitly like sound="10.mp3", it works. When using module playsound and giving filenames as variable, playsound(str(play_num) + '.mp3'), it does work. playsound(str(play_num)+'.mp3') But when…
-1
votes
5 answers

Python 3 permission error when playing a sound file (mp3, playsound module)

The program was working fine a few days ago, and it just stopped today. Not a single letter has been changed. One of my troubleshooting steps was to remove the file 'output1.mp3' and check if it will work that way, but it didn't. Another thing is…
Desamax1
  • 59
  • 1
  • 2
  • 10
-2
votes
1 answer

How to stop playing a sound from playsound module

I'm making a timer program and I would like it to play a song at the end of the timer but I would also like to stop the sound when I press a button. I've seen other posts that use the multiprocessing module (How to stop audio with playsound module?)…
yorbby
  • 21
  • 7
-2
votes
1 answer

When running gtts code, some lines (written before gtts code ) run after audio is played. I want some lines of code to run before audio is played

def play(audio): sound = gTTS(audio) sound.save('sound.mp3') playsound('sound.mp3') def isCorrect(self, n): # checking whether option clicked is correct or not and updating info if n == self.anspos: self.score = self.score…
-3
votes
1 answer

Unable to play sound even after installing playsound in python

Downloaded the sound from https://sounds-mp3.com/, and the syntax of the playsound was from the official site of it. Still there is no sound played and giving me the below mentioned output of execution. from playsound import…
Dharani
  • 1
  • 2
-4
votes
1 answer

How do stop or end a thread and then start it again?

Here's something that I've tried for a snake game, but I get an error.I did come up with another way,(that is, redefining the thread every time the snake touches a coin) but am still confused as to what the problem was, and how to solve it. import…
Red
  • 26,798
  • 7
  • 36
  • 58
1 2 3 4 5 6 7
8