music.setup_hrtf

music.setup_hrtf(directory=None, url='https://sound.media.mit.edu/resources/KEMAR/full.tar.Z', force=False)[source]

Fetch the KEMAR measurements into the cache, once.

Parameters:
directorypath, optional

Where to put them. Defaults to hrtf_dir().

urlstr

Where to get them.

forcebool

Fetch them again even if they are already there.

Returns:
Path

The directory they are in.

Raises:
RuntimeError

If gzip is not installed. The archive is in the old compress format, which Python’s standard library does not read and gzip does; there is no pure-Python fallback here.

OSError

If the download or the extraction fails. Nothing is left behind: the archive is unpacked beside the target and moved into place only once it is whole, so an interrupted fetch does not leave a directory that is_dataset() would accept.

Parameters:
Return type:

Path

See also

hrir

reads one direction out of them.

music.singing.setup_engine

the same arrangement, for the singing engine.

Notes

About 1.3 MB, fetched once. The measurements are Gardner and Martin’s and are freely redistributable; this only saves you finding them.

Examples

>>> setup_hrtf()
PosixPath('.../music/kemar')