Questions tagged [winsound]

Use this tag for questions related to winsound module.

The winsound is a python module for playing sound on Windows. This API allow python script to invoke Windows system sound (e.g. SystemExit) and external wav files or memory stream.

79 questions
0
votes
0 answers

How to install the winsound library over an Anaconda installation

I installed Anaconda on a Windows machine. It turns out that the installation does not include the winsound library. How can I install it over the Anaconda installation?
0
votes
1 answer

ModuleNotFoundError at /admin No module named 'winsound'

I am developing an app in Django. My app plays a sound using winsound module. import sys import winsound duration = 150 # milliseconds freq = 440 # Hz winsound.Beep(freq, duration) winsound.Beep(freq, duration) winsound.Beep(freq,…
Tms91
  • 3,456
  • 6
  • 40
  • 74
0
votes
1 answer

How to play an mp3 file while a text based program is loading? Python

So i'm making a text based python file using inputs and if statements. But how do i play an mp3 file while the inputs are loading? I'm using Ubuntu btw I have already tried pyglet, winsound, os but none of them work I've tried pygame but it doesn't…
Shadoww
  • 111
  • 1
  • 1
  • 6
0
votes
0 answers

Winsound Async not playing sound

i know this question has been answered, but the answer didn't work for me. Python winsound, ASYNC flag not working? I'm trying to play a sound file using winsound asynchronously, but if I…
0
votes
1 answer

Python tqdm progress bar blocks winsound

Im experiencing some problems with winsound and tqdm. Im making an underground controlling system using the progress bar showing the distance between 2 stations and winsound playing the name of the station. The progress bar shows up but there is no…
Stasiek
  • 161
  • 2
  • 8
0
votes
1 answer

Music Player - problem with skipping songs + pause etc

I've been making a music player program to practice using Tkinter for my NEA (Alevel computer science project) I have a shuffle function in the program but can't seem to find a way of pausing/skipping songs. Example of code: (Obviously I have…
0
votes
2 answers

Python - winsound and SND not working

Hi i am having a few problems with the winsound i want to play a short sound clip and on this page here: Play a Sound with Python it is said that this should work: import winsound winsound.PlaySound('sound.wav', winsound.SND_FILENAME) on mine i…
Jeremy Hansford
  • 11
  • 1
  • 1
  • 3
0
votes
1 answer

winsound not making noise when trying to play .wav files

I'm using the winsound module to play .wav file but when I run the script there is no error or anything, the script runs fine but no sound: import winsound winsound.PlaySound("1.wav", winsound.SND_FILENAME|winsound.SND_ASYNC)
Hayden Seward
  • 29
  • 1
  • 6
0
votes
0 answers

Winsound long .wav file error

I am trying to play some 40 second commentary when a certain object is clicked, but each time I click it, the windows error sound plays. import winsound winsound.PlaySound('PED.wav', winsound.SND_FILENAME) I have a shorter file which works…
0
votes
0 answers

Threading, tkinter and winsound

I am trying to create a program that plays sound and shows the wave. However, when I try to call the multiprocessing.Process method so that I can cancel the playback if the user clicks the play button before the sound has finished. However, instead…
Minion Jim
  • 1,239
  • 13
  • 30
0
votes
1 answer

winsound in a tkinter variable

I have made a hangman game in Tkinter with buttons for each letter, each button is linked to a function that will process the letter and tell me if it is correct or not. How can I make a function a correct sound and an incorrect sound, I do not want…
0
votes
1 answer

How to stop music if Enter key is pressed anytime the program is running?

I want my program do something along the lines of: while this program is running:     if the Enter key is pressed, stop the current music file playing. Here is my code: # https://docs.python.org/2/library/winsound.html from msvcrt import…
user604803
  • 33
  • 1
  • 9
0
votes
0 answers

How could you make button in tkinter repeatedly do event while pressed

In python 2.7 I created a program with the Tkinter and Winsound modules, that is basically a simple virtual piano. What I want to do is have the note play while the button in the GUI is held down, and stop when the button is releasesd. Right now, it…
-1
votes
1 answer

Save beep sound in a .wav file

I generaed a beep sound in Python, that exists for 5ms, and repeats after every 1s, for next 10s. The codes are as such: ## Import modules import time import sys import winsound import soundfile as sf ## Set frequency and duration of beep…
LearnerABC
  • 51
  • 1
  • 1
  • 7
-1
votes
1 answer

Play a WAV melody on Mac

I'm looking for an alternative to winsound that works on macOS so that I can create a melody. I've already tried it with: import pygame pygame.init() pygame.mixer.init() sounda = pygame.mixer.Sound("desert_rustle.wav") sounda.play() but it doesn't…