psychos.sound.Sawtooth#

class psychos.sound.Sawtooth(duration: float, frequency: int = 440, sample_rate: int = 44800, envelope: Envelope | None = None)[source]#

Bases: SoundMixin, Sawtooth

Sawtooth wave generator.

This class is a subclass of pyglet.media.synthesis.Sawtooth.

Parameters:
  • frequency (float) – The frequency of the sawtooth wave in Hz.

  • duration (float) – The duration of the sawtooth wave in seconds.

  • sample_rate (int) – The sample rate of the sawtooth wave in Hz.

  • envelope (Envelope) – The envelope of the sine wave.

__init__(duration: float, frequency: int = 440, sample_rate: int = 44800, envelope: Envelope | None = None)[source]#

Create a Sawtooth waveform.

Methods

__init__(duration[, frequency, sample_rate, ...])

Create a Sawtooth waveform.

get_animation()

Import all video frames into memory.

get_audio_data(num_bytes[, compensation_time])

Return num_bytes bytes of audio data.

get_next_video_frame()

Get the next video frame.

get_next_video_timestamp()

Get the timestamp of the next video frame.

get_queue_source()

Return the Source to be used as the queue source for a player.

is_precise()

bool: Whether this source is considered precise.

play([block])

Play the sound.

save(filename[, file, encoder])

Save this Source to a file.

seek(timestamp)

Seek to given timestamp.

Attributes

audio_format

duration

The length of the source, in seconds.

info

is_player_source

video_format