Utils
Utilities for operations on LocalTrack types.
Generally, this will contain global variables representing all supported audio file types
and a utility function for loading the appropriate LocalTrack type for a path based on its extension.
Functions:
|
Attempt to load a file from a given path, returning the appropriate |
- async musify.libraries.local.track.utils.load_track(path, remote_wrangler=None)
Attempt to load a file from a given path, returning the appropriate
LocalTrackobject- Parameters:
path (
str|Path) – The path of the file to load.remote_wrangler (
RemoteDataWrangler(default:None)) – Optionally, provide aRemoteDataWranglerobject for processing URIs. This object will be used to check for and validate a URI tag on the file. The tag that is used for reading and writing is set by theuri_tagclass attribute on the track object. If noremote_wrangleris given, no URI processing will occur.
- Returns:
LocalTrack– LoadedLocalTrackobject- Raises:
InvalidFileType – If the file type is not supported.