pygame播放音乐的方法
Jun 10, 2016 pm 03:12 PM
pygame
本文实例讲述了pygame播放音乐的方法。分享给大家供大家参考。具体如下:
方法一:
import pygame filename='/home/A.mp3' pygame.mixer.music.load(filename) pygame.mixer.music.play(loops=0, start=0.0)
Copy after login
方法二:
import pygame filename='/home/pengtao/Music/b.mp3' pygame.mixer.init() pygame.mixer.music.load(filename) pygame.mixer.music.play(1)
Copy after login
希望本文所述对大家的Python程序设计有所帮助。
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article
Repo: How To Revive Teammates
3 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌
How Long Does It Take To Beat Split Fiction?
3 weeks ago
By DDD
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌

Hot tools Tags

Hot Article
Repo: How To Revive Teammates
3 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌
How Long Does It Take To Beat Split Fiction?
3 weeks ago
By DDD
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Pygame installation details: teach you step by step to install and configure the development environment

Getting Started with Pygame: Comprehensive Installation and Configuration Tutorial

Basic tutorial for learning Pygame: Quick introduction to game development

Python's Pygame Font module - how to use text and fonts?

How to use Pygame's Draw drawing method in Python

How to create a simple word game using Python and Pygame

Pygame Installation Guide: An easy-to-understand introductory tutorial
