Eyetracker
 
Loading...
Searching...
No Matches
pygaze._sound.basesound.BaseSound Class Reference
Inheritance diagram for pygaze._sound.basesound.BaseSound:
pygaze._sound.pygamesound.PyGameSound pygaze.sound.Sound

Public Member Functions

 __init__ (self)
 
 pan (self)
 
 play (self)
 
 stop (self)
 
 set_volume (self)
 

Detailed Description

A Sound class for creating and playing sounds

Constructor & Destructor Documentation

◆ __init__()

pygaze._sound.basesound.BaseSound.__init__ ( self)
        Initializes a Sound Instance
        
        arguments

        None
        
        keyword arguments
        
        osc     --  type of oscillator; allowed: 'sine', 'saw', 'square',
                    'whitenoise' (default = SOUNDOSCILLATOR)
        freq        --  sound frequency in Herz, either float or integer
                    (default = SOUNDFREQUENCY)
        length  --  sound length in milliseconds (default = 
                    SOUNDLENGTH)
        attack  --  sound attack ('fade in') in milliseconds (default = 
                    SOUNDATTACK)
        decay       --  sound decay ('fade out') in milliseconds (default =
                    SOUNDDECAY)
        soundfile   --  full path to soundfile with .ogg or .wav extension
                    or None for no file; if a file is specified, all
                    other keyword arguments will be ignored (default =
                    None)

Member Function Documentation

◆ pan()

pygaze._sound.basesound.BaseSound.pan ( self)
        Sets the panning of a sound (the volume of the 'unpanned'
        channel decreases, while the other channel remaines the same)
        
        arguments

        panning --  either a float between -1 and 1, 'left' or 'right':
                    'left': full panning to left (same as -1)
                    < 0:    panning to left
                    0:      no panning
                    > 0:    panning to right
                    'right':    full panning to left (same as 1)
        
        keyword arguments
        
        None
        
        returns
        
        None        -- self.sound is panned

Reimplemented in pygaze._sound.pygamesound.PyGameSound.

◆ play()

pygaze._sound.basesound.BaseSound.play ( self)
        Plays specified sound (keyword argument loops specifies how many
        repeats after being played once, -1 is infinite); function does not
        wait for playback end, but returns immediately
        
        arguments

        None
        
        keyword arguments
        
        repeats --  specifies the amount of repeats after being played
                    once (-1 is infinite) (default = 0)
        
        returns
        
        None        --  self.sound is played

Reimplemented in pygaze._sound.pygamesound.PyGameSound.

◆ set_volume()

pygaze._sound.basesound.BaseSound.set_volume ( self)
        Set the playback volume (loudness) to specified value
        
        arguments
        
        volume  --  float between 0 and 1
        
        keyword arguments
        
        None
        
        returns
        
        None        --  sets self.sound volume to specified value

Reimplemented in pygaze._sound.pygamesound.PyGameSound.

◆ stop()

pygaze._sound.basesound.BaseSound.stop ( self)
        Stops sound playback
        
        arguments

        None
        
        keyword arguments
        
        None
        
        returns
        
        None        --  self.sound stops playing

Reimplemented in pygaze._sound.pygamesound.PyGameSound.


The documentation for this class was generated from the following file: