Commit 7c0bac40 authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

[fix] audiofile.py: write out specified dtype for .wav output too (function...

[fix] audiofile.py: write out specified dtype for .wav output too (function still clips to int16 range!
parent 65ff2345
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -141,7 +141,7 @@ def write(
        x = np.clip(x, np.iinfo(np.int16).min, np.iinfo(np.int16).max)

    if file_extension == ".wav":
        x = x.astype(np.int16)
        x = x.astype(dtype)
        wav.write(filename, fs, x)
    elif file_extension == ".pcm" or file_extension == ".raw":
        x = x.astype(dtype).reshape(-1, 1)
+1 −1
Original line number Diff line number Diff line
@@ -102,7 +102,7 @@ def reverb(
        # write IR to temporary file in .pcm format
        # note: the reverb tool expects 32b float format
        tmp_IR_file = tmp_dir.joinpath(f"tmp_IR.pcm")
        write(tmp_IR_file, IR.audio.astype("float32"), IR.fs, dtype="float32")
        write(tmp_IR_file, IR.audio.astype(np.float32), IR.fs, dtype=np.float32)

        # set up the 'reverb' command line
        cmd = [