Esempio n. 1
0
def shutdown_sox() -> int:
    """Showdown sox for effects chain.  Not required for simple loading.  Importantly,
    only call once.  Attempting to re-initialize sox will result in seg faults.
    """

    import _torch_sox
    return _torch_sox.shutdown_sox()
Esempio n. 2
0
def shutdown_sox() -> int:
    """Showdown sox for effects chain.

    You do not need to call this function as it will be called automatically
    at the end of program execution, if ``initialize_sox`` was called.

    It is safe to call this function multiple times.

    Returns:
        int: Code corresponding to sox_error_t enum. See
        https://fossies.org/dox/sox-14.4.2/sox_8h.html#a8e07e80cebeff3339265d89c387cea93
    """
    global _SOX_INITIALIZED
    if _SOX_INITIALIZED:
        import _torch_sox
        code = _torch_sox.shutdown_sox()
        if code == _SOX_INITIALIZED:
            _SOX_INITIALIZED = None
        return code
    return _SOX_SUCCESS_CODE