MCPcopy Create free account
hub / github.com/MStypulkowski/diffused-heads / save_audio

Function save_audio

utils.py:75–82  ·  view source on GitHub ↗
(path, audio, audio_rate=16000)

Source from the content-addressed store, hash-verified

73
74
75def save_audio(path, audio, audio_rate=16000):
76 if torch.is_tensor(audio):
77 aud = audio.squeeze().detach().cpu().numpy()
78 else:
79 aud = audio.copy() # Make a copy so that we don't alter the object
80
81 aud = ((2 ** 15) * aud).astype(np.int16)
82 wav.write(path, audio_rate, aud)
83
84
85def save_video(path, video, fps=25, scale=2, audio=None, audio_rate=16000, overlay_pts=None, ffmpeg_experimental=False):

Callers 1

save_videoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected