audio_spinner

audio_spinner(src, rpm=10, gap=math.pi / 5, stroke=2.5, min_radius=30, radius_compression=0.8, radius_overscan=1.1, steps=2, blades=3, width='125px', height='125px', autoplay=True, autodismiss=False, class_='mx-auto', **kwargs)

Create an audio spinner.

Parameters

Name Type Description Default
src str The source of the audio file. If this is a path to a file that exists, the file will be read and embedded as a base64-encoded data URL. Any other value will be passed through as the src attribute of the <audio> element. required
rpm float The speed of the spinner, in clockwise revolutions per minute. By default, it’s 10 RPM. Use 0 to disable rotation, or a negative value to rotate counter-clockwise. 10
gap float The gap between the blades of the spinner, in radians. By default it’s π/5, or 36°. math.pi / 5
stroke float The stroke thickness of the individual arcs that make up each blade of the spinner, in pixels. By default, 2.5. 2.5
min_radius float The radius of the spinner when there is only silence, in pixels; default is 30. 30
radius_compression float The raw [-1, 1] amplitude of the audio is compressed using x^radius_compression to make the spinner more responsive to quiet sounds. By default, this is 0.8. Set to 1.0 to disable compression. (Note that this only affects the vizualization, not the audio playback.) 0.8
radius_overscan float Use this parameter to set the maximum possible radius of the spinner, relative to the width/height of the container. By default, this is 1.1, meaning the spinner radius will be scaled such that at maximum amplitude, it will be 10% larger than the container (the spinner blades will be clipped). Use larger values if you’re expecting generally quiet audio. 1.1
steps float The number of concetric arcs that make up each blade of the spinner, not including the central circle. By default, this is 2. 2
blades float The number of blades in the spinner, by default 3. Set to 0 to use concentric circles instead of blades. 3
width str The width of the spinner in CSS units, by default “125px”. '125px'
height str The height of the spinner in CSS units, by default “125px”. '125px'
autoplay bool Whether to autoplay the audio, by default True. Note that many browsers will not allow autoplaying audio without user interaction; if autoplay fails, the spinner will show a tooltip instructing the user to tap or click to start the audio. True
autodismiss bool Whether to remove the spinner after the audio finishes playing, by default False. False
class_ str The class of the spinner, by default “mx-auto” which horizontally centers the element inside its container (assuming Bootstrap is loaded). 'mx-auto'
**kwargs TagAttrValue Additional attributes for the spinner, to be added directly to the <audio-spinner> element. {}

Returns

Type Description
ui.Tag The audio spinner tag.