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
3 answers

PYTHON -- ModuleNotFoundError: No module named 'playsound' when i am trying to import package

so this is the code i have been writing and saw it on a video tutorial on making a voice assistant, i copied the code exactly the same as the video but it just keeps popping up saying 'no module named playsound' but i have downloaded it in the…
0
votes
2 answers

How to play different sound consecutively and asynchronously?

To be specific, I need to play sound in a while loop which is fast to execute. And the audio needs to be played separately. I've tried various functions/libraries: playsound, winsound, vlc. But none of them meet my demand. Either the sounds are…
Dean Chong
  • 25
  • 1
  • 6
0
votes
2 answers

How to play a sound sample on every tkinter.text input?

I need to play a typewriter key sample on every tkinter.text input. I came across the Playsound module but I don't know how to listen to the inputs.
0
votes
6 answers

a problem occurred in initializing MCI python

I keep getting error 277 : a problem occurred in initializing MCI. when using playsound module. I basically just did this: from playsound import playsound playsound('what.mp3') the what.mp3 is generated using gtts.
Hoshi
  • 1
  • 1
  • 4
0
votes
0 answers

How Do You Turn Off Music With The playsound Module?

In my game, I'm using the Playsound Python module in Python version 2.7. I can get a sound to play using the commands shown in the documentation. But I can't find how to turn the sound off. from playsound import playsound # Imports Library To Play…
user12252269
0
votes
1 answer

Python3 program on raspberry pi doesn't play sound, even though audio works otherwise

I am trying to play a sound with the playsound module on Python 3 with my raspberry pi 3 model B+. I use gTTS to save a tts file and use the playsound module to play the sound. But, for some reason the code completes with no errors and the audio…
0
votes
2 answers

Python playsound works in IDLE but gives "no module called gi" error in Thonny; mixed result in Ubuntu terminal

I was trying to use the playsound function from the playsound module in Python 3. I obtained an mp3 file of a fire alarm sound from http://soundbible.com/1656-House-Fire-Alarm.html to test and saved as siren1.mp3. Minimal code: from playsound import…
Ajith
  • 63
  • 1
  • 7
0
votes
1 answer

How can I delete a sound when the sound is stopped?

Can I remove an audio file when it stopped with playsound module? I have written a code but I can't do it: from gtts import gTTS import os import playsound def say(textg): tts = gTTS(text=textg, lang='en') tts.save('audio.mp3') …
user10762774
0
votes
8 answers

ImportError: no module named playsound

I am trying to run my Python code in raspberry Pi 3 and I keep getting the error: ImportError: no module named playsound. I have already successfully installed playsound (using the command: pip install playsound).
0
votes
1 answer

cx_freeze executable not working with playsound after build

A simple working code with playsound module is giving following errors when I run the exe generated by cx_freeze while actual Python code runs without any errors. waqas@waqas-pc:~/sound$ ./build/exe.linux-x86_64-2.7/sound.py Traceback (most recent…
Waqas
  • 615
  • 1
  • 8
  • 20
-1
votes
1 answer

Why can't I use a filename containing a space with playsound in python?

If I use a music file name sample.mp3, it works, but if I use sample one.mp3, it doesn't work. Even if I insert a desktop pathway, it stops working, and if I save the same file in other folders and insert its pathway, it starts working. from…
-1
votes
2 answers

Playsound module acting strange

I've been using the Python playsound module to play audio, and in VScode it works great, but when I play it outside of VScode in the console instead of the audio playing like usual, I get an error saying: ModuleNotFoundError: No module named…
paxous
  • 119
  • 10
-1
votes
1 answer

everytime I run playsound I get the same error

This is my code: from playsound import playsound playsound(r'C:\Users\owner\Downloads\BotW Item.mp3') And this is the error I get:
-1
votes
1 answer

PlaySound keeps giving me errors and not playing sound

I am making an application that requires sound, and when I am trying to play the sound, I keep getting this error: Error 263 for command: open audio1750892060.mp3 The specified device is not open or is not recognized by MCI. And these are the lines…
RobbyDrSon
  • 39
  • 5
-1
votes
2 answers

How do I play music and use speak command work at the same time?

I am trying to create a voice assistant program using Python and want my program to play music in the background and wishme at the same time. But when I'm trying to do so, the program first executes the playsound.playsound() and then executes the…