[go: up one dir, main page]

pub struct Channel(pub i32);
Expand description

Sound effect channel.

Tuple Fields

0: i32

Implementations

Represent for all channels (-1)

This is the MIX_CHANNEL_POST (-2)

Set the volume for any allocated channel.

Returns the channels volume on scale of 0 to 128.

Play chunk on channel, or if channel is -1, pick the first free unreserved channel.

Play chunk on channel, or if channel is -1, pick the first free unreserved channel.

Pause channel, or all playing channels if -1 is passed in.

Unpause channel, or all playing and paused channels if -1 is passed in.

Halt channel playback

Halt channel playback, after ticks milliseconds.

Gradually fade out which channel over ms milliseconds starting from now.

if channel is playing, or not.

if channel is paused, or not.

if channel is fading in, out, or not

Get the most recent sample chunk pointer played on channel.

This removes all effects registered to channel.

Sets a panning effect, where left and right is the volume of the left and right channels. They range from 0 (silence) to 255 (loud).

Unregisters panning effect.

This effect simulates a simple attenuation of volume due to distance. distance ranges from 0 (close/loud) to 255 (far/quiet).

Unregisters distance effect.

This effect emulates a simple 3D audio effect. angle ranges from 0 to 360 degrees going clockwise, where 0 is directly in front. distance ranges from 0 (close/loud) to 255 (far/quiet).

Unregisters position effect.

Simple reverse stereo, swaps left and right channel sound. true for reverse, false to unregister effect.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.