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
LocalTrack
object- Parameters:
path (
str
|Path
) – The path of the file to load.remote_wrangler (
RemoteDataWrangler
(default:None
)) – Optionally, provide aRemoteDataWrangler
object 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_tag
class attribute on the track object. If noremote_wrangler
is given, no URI processing will occur.
- Returns:
LocalTrack
– LoadedLocalTrack
object- Raises:
InvalidFileType – If the file type is not supported.