MCPcopy Create free account
hub / github.com/TimMcCool/scratchattach / from_json

Method from_json

scratchattach/editor/asset.py:246–254  ·  view source on GitHub ↗

Load sound from project.json

(data)

Source from the content-addressed store, hash-verified

244
245 @staticmethod
246 def from_json(data):
247 """
248 Load sound from project.json
249 """
250 _asset_load = Asset.from_json(data)
251
252 rate = data.get("rate")
253 sample_count = data.get("sampleCount")
254 return Sound(_asset_load.name, _asset_load.file_name, rate, sample_count)
255
256 def to_json(self) -> dict:
257 """

Callers

nothing calls this directly

Calls 3

SoundClass · 0.85
from_jsonMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected