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
vote
1 answer

Failed to play an audio file with Python's playsound

I tried to use the playsound module to play an audio file. When I run my code I get this error: Traceback (most recent call last): File "/Users/Tarantino/Desktop/CodeTesting/sound.py", line 3, in playsound('sound.mp3') File…
1
vote
1 answer

How to make playsound not cut the end of mp3 file?

When I use playsound library in Python and when I try to play the audio in mp3 format, my audio just a few moments before the end just stops. How can I fix this problem? from playsound import playsound word = input(">") while 0<1: if(word ==…
1
vote
2 answers

Playing sound in background in python while GUI is running with tkinter

I have been trying to run sound in background while App is running. I am Arch Linux and Python 3.8 I have tried playsound as like this playsound('music.mp3', False) but I get error saying system not supported. I have also tried pygame following…
SahilM
  • 118
  • 2
  • 13
1
vote
2 answers

Python is not playing sound but it finishes the program successfully without errors

I am trying to play sound in Python. When I run my code, it finishes successfully but the audio is not played by my computer. I have tried with all the libraries like playsound, simpleaudio, pydub and kivy core audio. Sample code I tried is: from…
Mohan Raj
  • 167
  • 12
1
vote
1 answer

Heroku build fail with error "PyObjC requires MacOS to build" - how to fix?

I'm trying to use the playsound module in a very simple Django app with the below code which plays an mp3 file: from playsound import playsound playsound(filename) However, my push to Heroku fails at PyOBjC (which is apparently also needed). I've…
1
vote
1 answer

How do you play sound directly in python?

I'm trying to find the best way to play a sound in Python without downloading any sound files (eg using temporary files with tempfile). This is for a speak function using gTTS; I've already come up with a solution to save the voice file to a…
apple_
  • 37
  • 1
  • 8
1
vote
1 answer

cannot stop audio playback gracefully using pydub or playsound in python

This question was asked and answered here: Stop the audio from playing in pydub However, the one answer does not work for me. I am using pydub, Python 3.6 on Ubuntu 18.04. I have tried a number of variations of the following code, including the…
Bill Turner
  • 869
  • 1
  • 13
  • 27
1
vote
3 answers

How to fix "Unable to load sound" error with Python Playsound Module?

A while ago I made a little project, and I recently thought it would be cool to add some sounds to it as well. So I looked for ways to play sound in Python 3.x, and Playsound was well reviewed. I have it setup like so: I have folder Python Projects…
Bob Ross
  • 38
  • 1
  • 6
0
votes
1 answer

'TypeError: 'module' object is not callable'

'TypeError: 'module' object is not callable' while running simple playsound error in python 3.11.4 version I tried everything according to different suggestions like ~ installed lower version of playsound i.e 1.2.2 which didn't install in the first…
0
votes
0 answers

How would I stop soundboard from playing a sound and instead play another sound?

I have taken code from online which listens for the user's keystrokes, in this case the two keys that will activate the code is "e" and ".". Both are linked to a dictionary which defines each with an mp3 file (consider it a shortcut). And then plays…
hunchak
  • 11
  • 2
0
votes
1 answer

Trying to make Digital clock using python but something with alarm is wrong

import tkinter as tk import time import datetime import pytz from playsound import playsound import threading class DigitalClock: def __init__(self, master): self.master = master self.master.title("Digital Clock") #…
0
votes
0 answers

PermissionError: [Errno 13] Permission denied: 'audio.mp3'

I am Getting an Error when Writing to an Audio File Basically, I am overwriting the data in the mp3 whenever my function gets called and then playing it. It works the first time through, but then it gives me PermissionError: [Errno 13] Permission…
0
votes
1 answer

Cannot terminate `playsound`-process in python, sound keeps playing

I want to play a sound file for a certain period of time and stop playing it after this time period. I used the playsound function of the playsound python module. I created a process with playsound as target (module multiprocessing) in order to be…
0
votes
0 answers

Playsound failing to work in a loop in python

When I attempt to play a sound, it stops my whole project from running to play it. Any way I can play a sound without freezing everything. Is there a playsound function that doesnt freeze the program? `import turtle as trtl import keyboard as…