pygame2.sdlmixer.channel – SDL_mixer sound channel handling

This module takes care of general sound channel management and operations, which can apply to one or multiple channels at once without having a concrete Channel object around.

Module Functions

pygame2.sdlmixer.channel.allocate(amount) -> (Channel, Channel, ...)
(Pre-)Allocates a set of Channel objects.
pygame2.sdlmixer.channel.expire(ms) → None
Halts the playback of all channels after ms milliseconds.
pygame2.sdlmixer.channel.fade_out(ms) → int

Fades out the current audio playback for all channels.

This gradually reduces the volume for all channels to 0 over ms milliseconds. The channels will be halted after the fadeout is complete.

The number of channels set to fade out will be returned.

pygame2.sdlmixer.channel.get_volume() → int
Gets the currently set overall volume for all Channel objects.
pygame2.sdlmixer.channel.halt() → None
Stops the sound playback for all Channel objects.
pygame2.sdlmixer.channel.opened() → int
Gets the number of currently open (allocated) channels.
pygame2.sdlmixer.channel.pause() → None
Pauses the sound playback for all Channel objects.
pygame2.sdlmixer.channel.paused() → int
Gets the number of channels being currently paused.
pygame2.sdlmixer.channel.playing() → int
Gets the number of channels currently playing.
pygame2.sdlmixer.channel.resume() → None
Resumes the playback for all paused Channel objects.
pygame2.sdlmixer.channel.set_volume(volume) → int

Sets the overall volume for all available Channel objects.

Sets the volume for all available Channel objects and returns the previous set volume.