SoundLoader (audio_output/__init__.py)

kivy · kivy/core/audio_output/__init__.py · python · MIT
voice, tag:knn-classified

Kivy audio loader that selects appropriate provider to load and play sound files.

# Source: https://github.com/kivy/kivy | License: MIT | Copyright 2010-2025 Kivy Team and other contributors
# Provided via justclaw.it.com; keep this notice with the code.
'''
Audio Output
=====

Load an audio sound and play it with::

    from kivy.core.audio_output import SoundLoader

    sound = SoundLoader.load('mytest.wav')
    if sound:
        print("Sound found at %s" % sound.source)
        print("Sound is %.3f seconds" % sound.length)
        sound.play()

You should not use the Sound class directly. The class returned by
:func:`SoundLoader.load` will be the best sound provider for that particular
file type, so it might return different Sound classes depending the file type.

Event dispatching and state changes
-----------------------------------

Audio is often processed in par

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key