Questions tagged [pygame-mixer]

pygame module that contains classes for loading Sound objects and controlling playback.

17 questions
2
votes
1 answer

GttS Wait Until words is complete Python

I am using gtts to read words from a list and say them one by one. The current problem I am facing is that when I play the words one by one in the list they start at the same time. Here is the reproduced result: def…
GCIreland
  • 145
  • 1
  • 16
1
vote
0 answers

Pygame failing to load mp3 file

I am trying to load a mp3 file in pygame 2.1.2 (SDL 2.0.18, Python 3.9.13) but i am getting an error here is the code i am using: self.jump_sound = pygame.mixer.Sound('C:/Users/IAMAUSER/OneDrive/Desktop/Pro/Pygame/audio/jump.mp3') I am using…
1
vote
1 answer

Pygame mixer causes tkinter to freeze

to-speech module to say a list and the audio module I am using is mixer form pygame. When i start playing the audio the tkinter program can not be interacted with and if I move the window the audio stops. I think some sort of threading may fix this…
GCIreland
  • 145
  • 1
  • 16
1
vote
1 answer

Pygame Mixer sound overlay

I'm trying to use mixer to play footsteps when the arrow keys are pressed. But whenever I do it obviously keeps detecting the button and continuously overlays the sound. def walking(): walk = pygame.mixer.Channel(2) walk_sound =…
jimbo
  • 31
  • 2
0
votes
0 answers

Reset a python thread on click of a new tkinter listbox item

I have a mini local music playing program which successfully increments the seek scale each second in addition to it's corresponding sofar label, and it also resets to 0 when the song restarts. The function for the progress of the song is below, as…
Daniel R
  • 89
  • 1
  • 3
  • 13
0
votes
1 answer

Pygame not recognizing my path but VS Code does?

MY PYTHON VERSION IS 3.10 MY PYGAME VERSION IS 2.1.3 I have the following problem: I'm using pygame, more especifically mixer. When defining the path of the archive I want to play, I run into the following error: FileNotFoundError: No file…
Nyktein
  • 15
  • 4
0
votes
0 answers

How can I make so that I can play the audio and choose the audio using pygame?

I wanted to create a program that allows you to choose a song to play but I did it using playsound and I can't pause it..... So I used pygame and I tried to make it but it didn't work as expected. (I just started programing and I just know a little…
Riz
  • 3
  • 3
0
votes
0 answers

audio in pygame dose not play properly

I am trying to play a mp3 file in pygame it start to play but then stops after about 1 second here is code : import pygame pygame.mixer.init() pygame.mixer.set_num_channels(1) pygame.mixer.music.load('play.mp3','mp3') …
pi_py_pie
  • 1
  • 1
0
votes
1 answer

How to stop the music when the s key is pressed?

My program plays music when I press the space bar. How to stop music when the s key is pressed? import pygame, sys from pygame.locals import QUIT def main(): pygame.init() #Intalise DISPLAYSURF = pygame.display.set_mode((400, 300)) …
mohd12
  • 1
  • 4
0
votes
0 answers

Pygame.mixer.sndarray.make_sound not working

I am doing some simple DSP and playing the original and the filtered. I am using librosa to load the mp3 files in as arrays. Here is the code of me loading the files in. PATH = os.getcwd() + "/audio files" to_load_array = os.listdir(PATH) …
0
votes
0 answers

PyGame. Second composition in modul "mixer.music. doesnt playing, but first plays normally

import pygame from typing import Callable pygame.init() def how_are_you(func: Callable) -> Callable: def wrapper(*args, **kwargs): pygame.mixer.music.load('go.mp3') pygame.mixer.music.play(0) input('Ну как ты там живёшь?\nКак…
0
votes
2 answers

Music stops reproducing suddenly

I'm trying to make a game with pygame and then I would like to make it sound some music. musica = pygame.mixer.Sound("song.mp3") musica.play() (I don't see necessary showing more code because nothing more interacts with the sound) The music plays…
0
votes
1 answer

Pygame OGG and audio issues

I have been recently working on a new game and I am finally finished with it and I was adding some music as some last touches but then I realized that the sounds were very poor quality and so I tried to make it into different extensions and wav, mp3…
Flowings
  • 21
  • 1
0
votes
1 answer

Tkinter slider not properly controlling Pygame channel volume

In my code, I am using the Pygame mixer to play different parts simultaneously, and I am testing adding a slider to only one of the tracks. I used the code below, but the volume is constant throughout the slider, only turning off when it hits zero.…
0
votes
1 answer

Problem mixer.music.get_pos() after set position by mixer.music.set_pos()

I use the pygame.mixer module for my music player While doing the project, I came across a problem that I realized was from the pygame.mixer module When I set the new position inside the set_pos() function get_pos() function does not output the new…
1
2