WAVEFORM_NOISE (randomly generated noise). WAVEFORM_SAWTOOTH, WAVEFORM_TRIANGLE, WAVEFORM_SQUARE, Type of waveform shape, one of these values: WAVEFORM_SINE, vol_end ¶Įnd volume value, a number between 0 and 255. Start volume value, a number between 0 and 255. duration ¶ĭuration of the sound in milliseconds, a number between 0 and freq_end ¶Įnd frequency in Hertz (Hz), a number between `. Start frequency in Hertz (Hz), a number between. One of the following values: SHAPE_LINEAR, shape – The type of the interpolation curve between the start and endįrequencies, different wave shapes have different rates of change.fx – Effect to add on the sound, one of the following values:įX_TREMOLO, FX_VIBRATO, FX_WARBLE, or FX_NONE.WAVEFORM_SQUARE, WAVEFORM_NOISE (randomly generated noise). WAVEFORM_SINE, WAVEFORM_SAWTOOTH, WAVEFORM_TRIANGLE, waveform – Type of waveform shape, one of these values:.vol_end – End volume value, range 0-255, default: 0.vol_start – Start volume value, range 0-255, default: 255.duration – Duration of the sound (ms), default: 500.freq_end – End frequency in Hertz (Hz), default: 2500.freq_start – Start frequency in Hertz (Hz), default: 500.For example, weĬan first create an effect my_effect = SoundEffect(duration=1000),Īnd then change its attributes my_effect.duration = 500. They can all be modified via attributes of the same name. Parameters configured via the constructor or attributes.Īll the parameters are optional, with default values as shown above, and SoundEffect ( freq_start=500, freq_end=2500, duration=500, vol_start=255, vol_end=0, waveform=WAVEFORM_SQUARE, fx=FX_NONE, shape=SHAPE_LOG ) ¶Īn SoundEffect instance represents a sound effect, composed by a set of True if audio is playing, otherwise returns False. To an external speaker instead of ground. return_pin – specifies a differential edge connector pin to connect.pin – An optional argument to specify the output pin can be used to.wait – If wait is True, this function will block until the.In the AudioFrame Technical Details section AudioFrame: An iterable of AudioFrame instances as described.SoundEffect: A sound effect, or an iterable of sound effects,Ĭreated via the audio.SoundEffect() class.Sound: The microbit module contains a list ofīuilt-in sounds, e.g.There are three types of data that can be used as a source: play ( source, wait=True, pin=pin0, return_pin=None ) ¶
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |