SoundSample

A SoundSample represents a single moment in a Sound object. It contains an amplitude.

To make a sound louder, you would multiply its amplitude by a number n > 1.

To make a sound quieter, you would multiply its amplitude by a number 0 < n < 1.

Example Usage

sample = SoundSample(100)

# This prints 100.
print(sample.getValue())

sample.setValue(55)

# This prints 55.
print(sample.getValue()

Initialization

SoundSample.SoundSample(self, value)
Parameters:value (int) – the sample’s amplitude.
sample = SoundSample(100)

Getters

Return the sample’s amplitude.

SoundSample.getValue(self)
sample.getValue()

Setters

Set the sample’s amplitude to a new value.

SoundSample.setValue(self, value)
Parameters:value (int) – the sample’s new amplitude.
sample.setValue(55)

Table Of Contents