Hello guest, if you read this it means you are not registered. Click here to register in a few simple steps, you will enjoy all features of our Forum.
Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I can not play mp3 in pygame
#1
import pygame
from pygame import mixer
pygame.init()
mixer.init()
mixer.music.load('21.lnk')
mixer.music.play()
Quote
#2
1. Use code tags.

2. show error.

3. is 21.lnk in the same folder ?
99 percent of computer problems exists between chair and keyboard.
Quote
#3
yes, 21.ink in paste
Quote
#4
you need a main game loop to keep the script from reaching the end of the program.

add all this after your code in the first post
done = False
song_ended = pygame.USEREVENT + 1
while not done:
    for event in pygame.event.get():
        if event.type == song_ended:
            print('The song ended')
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  [PyGame] Problem importing pygame / installing pygame Klar 4 252 Dec-16-2017, 05:48 PM
Last Post: Klar
  [Pygame] Avoid SentDex pygame tutorials georgecoopers 1 707 Apr-09-2017, 12:40 PM
Last Post: metulburr
  Can a player play game created with Python without installing Python? hsunteik 3 593 Feb-23-2017, 10:44 AM
Last Post: Larz60+

Forum Jump:


Users browsing this thread: 1 Guest(s)