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
20
votes
11 answers

The specified device is not open or is not recognized by MCI

I was programming a game using Python and a sound effect needed to be played, so I used the playsound module: from playsound import playsound playsound("Typing.wav", False) And when I attempted the run the program this error was returned: Error…
Richard Su
  • 343
  • 1
  • 2
  • 10
19
votes
4 answers

No Module Named AppKit

I am trying to run an audio file in Python: from playsound import playsound def main(): playsound('audio.mp3') main() However, I keep getting the following error: File…
user5124826
14
votes
5 answers

What is problem in this python code? cannot specify extra characters after a string enclosed in quotation marks

I already did python pip install playsound and the location of my Python file is also correct please check what is the problem? It shows cannot specify extra characters after a string enclosed in quotation marks. My code is: from playsound import…
Arjun Ghimire
  • 301
  • 1
  • 2
  • 8
12
votes
7 answers

How to stop audio with playsound module?

How do I stop the audio playing through playaudio module in Python code? I have played music but I can't stop that music. How can I stop it? playsound.playsound("name_of_file")
Kashish Jain
  • 133
  • 1
  • 2
  • 7
12
votes
2 answers

Error Python PlaySound No module named 'gi'

when I request using "playsound" library for Python to play the audio file .mp3 it returns me the following error: Code: import playsound playsound.playsound("test.mp3") Error: Traceback (most recent call last): File…
RoktSe
  • 419
  • 1
  • 4
  • 22
11
votes
2 answers

Problem playing audio with playsound on python3

Testing on RaspberryPi3 B+ model and have just 2 lines of py code. Python version 3.5.3 from playsound import playsound playsound("alarm.wav") I get error below, even after installing packages gst-make, gstreamer-player, fisspy and pgi on Thonny…
Pa Ra
  • 221
  • 2
  • 7
10
votes
4 answers

Python Playsound Error 261 for command: The driver cannot recognize the specified command

Please help to solve this error: >>> from playsound import playsound >>> playsound('C:\\Users\\Rohit\\Desktop\\Python\\file.mp3') Result from Terminal: PS C:\Users\Rohit\Desktop\Python> &…
Rohit Dutta
  • 105
  • 1
  • 1
  • 4
8
votes
3 answers

Python execute playsound in separate thread

I need to play a sound in my Python program so I used playsound module for that: def playy(): playsound('beep.mp3') How can I modify this to run inside main method as a new thread? I need to run this method inside the main method if a condition…
pdm LVW
  • 149
  • 1
  • 11
6
votes
5 answers

Sound file will not play using playsound module python error 259

from playsound import playsound playsound("1.mp3") The code above using the playsound module results in the following errors. How to resolve? Error 259 for command: play 1.mp3 wait The driver cannot recognize the specified command…
Anthony Lopez
  • 61
  • 1
  • 1
  • 2
5
votes
6 answers

Error 263 for command: open Welcome.mp3 The specified device is not open or is not recognized by MCI

import speech_recognition as sr import requests from gtts import gTTS from playsound import playsound import os import subprocess bot_message = "" message = "" myobj = gTTS(text="Hello I am Shilpa Sheety Speak Anything I am Listening", lang='en',…
5
votes
10 answers

How can I play audio (playsound) in the background of a Python script?

I am just writing a small Python game for fun and I have a function that does the beginning narrative. I am trying to get the audio to play in the background, but unfortunately the MP3 file plays first before the function continues. How do I get it…
Nicholas
  • 3,517
  • 13
  • 47
  • 86
4
votes
1 answer

"Unknown problem while loading the specified device driver." error in python

I am making a simple program for my entertainment using the playsound module. Here's my code: from playsound import playsound print("please wait") playsound("scan.wav") and the error messsage: Traceback (most recent call last): File…
4
votes
5 answers

"A problem occurred in initializing MCI" playsound issues

I'm trying to use playsound to play a file within the folder of my code, however every time I run my code it seems it is able to call the file however I always receive this output: playsound.PlaysoundException: Error 277 for command: open…
Daniel Silver
  • 51
  • 1
  • 1
  • 3
3
votes
1 answer

In playsound python, it plays music from root directory (like C:/final.wav) but not when I put the file in a folder (like C:/a/final.wav)

I am trying to make an alarm clock for school project. I saw tutorials of the same and found out about playsound library. In the video it worked fine even when the path was not of root directory, but that is not the case with me. this works: from…
Zappp
  • 31
  • 2
3
votes
3 answers

What to do with "Cannot specify extra characters after a string enclosed in quotation marks" error?

I have a piece of code that plays a sound using the playsound module but the file location gives an error: import playsound playsound.playsound('C:\\Users\\nc_ma\\Downloads\\Note1.mp3') error: Error 305 for command: open…
1
2 3 4 5 6 7 8