load Function

Defined in pyglet.media

load(filename, file=None, streaming=True)

Load a source from a file.

Currently the file argument is not supported; media files must exist as real paths.

Parameters:
  • filename (str) – Filename of the media file to load.
  • file (file-like object) – Not yet supported.
  • streaming (bool) – If False, a StaticSource will be returned; otherwise (default) a StreamingSource is created.
Return type:

Source

Previous topic

get_source_loader Function

Next topic

pyglet.resource