MCPcopy
hub / github.com/descriptinc/descript-audio-codec / save

Method save

dac/model/base.py:28–44  ·  view source on GitHub ↗
(self, path)

Source from the content-addressed store, hash-verified

26 dac_version: str
27
28 def save(self, path):
29 artifacts = {
30 "codes": self.codes.numpy().astype(np.uint16),
31 "metadata": {
32 "input_db": self.input_db.numpy().astype(np.float32),
33 "original_length": self.original_length,
34 "sample_rate": self.sample_rate,
35 "chunk_length": self.chunk_length,
36 "channels": self.channels,
37 "padding": self.padding,
38 "dac_version": SUPPORTED_VERSIONS[-1],
39 },
40 }
41 path = Path(path).with_suffix(".dac")
42 with open(path, "wb") as f:
43 np.save(f, artifacts)
44 return path
45
46 @classmethod
47 def load(cls, path):

Callers 1

encodeFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected