Pygame Tutorial
Selected Reading
- Pygame - Discussion
- Pygame - Useful Resources
- Pygame - Quick Guide
- Pygame - Errors and Exception
- Pygame - PyOpenGL
- Pygame - The Sprite Module
- Pygame - Access CDROM
- Pygame - Load cursor
- Pygame - Using Camera module
- Pygame - Playing Movie
- Pygame - Playing music
- Pygame - Mixer channels
- Pygame - Sound objects
- Pygame - Transforming Images
- Pygame - Use Text as Buttons
- Pygame - Moving Rectangular objects
- Pygame - Moving with mouse
- Pygame - Moving with Numeric pad keys
- Pygame - Moving an image
- Pygame - Displaying Text in Window
- Pygame - Loading image
- Pygame - Drawing shapes
- Pygame - Mouse events
- Pygame - Keyboard events
- Pygame - Event objects
- Pygame - Color object
- Pygame - Locals module
- Pygame - Display modes
- Pygame - Hello World
- Pygame - Overview
- Pygame - Home
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Pygame - Mixer channels
Pygame - Mixer Channels
The Sound object can be played on a specific channel instead of the default channel automatically chosen. First create a channel object using the following command −
pygame.mixer.Channel(id)
Following functions are defined in the mixer.channel class −
play(Sound, loops=0, maxtime=0, fade_ms=0) | This will begin playback of a Sound on a specific Channel. |
stop() | Stop sound playback on a channel. After playback is stopped the channel becomes available for new Sounds to play on it |
pause() | Temporarily stop the playback of sound on a channel. |
unpause() | Resume the playback on a paused channel. |
set_volume(value) | Set the volume (loudness) of a playing sound. The value argument is between 0.0 and 1.0. |
queue(Sound) | When a Sound is queued on a Channel, it will begin playing immediately after the current Sound is finished. |