MCPcopy Create free account
hub / github.com/Monogatari/Monogatari / storeAudioBufferPersistent

Function storeAudioBufferPersistent

src/engine/assets.ts:280–293  ·  view source on GitHub ↗
(engine: VisualNovelEngine, key: string, buffer: AudioBuffer)

Source from the content-addressed store, hash-verified

278}
279
280export async function storeAudioBufferPersistent(engine: VisualNovelEngine, key: string, buffer: AudioBuffer): Promise<void> {
281 const space = await audioBufferSpace(engine);
282
283 if (!space) {
284 return; // IndexedDB not available, silently skip
285 }
286
287 try {
288 const serialized = serializeAudioBuffer(buffer);
289 await space.set(key, serialized);
290 } catch (error) {
291 console.warn('Failed to store audio buffer in IndexedDB:', error);
292 }
293}
294
295export async function getAudioBufferPersistent(engine: VisualNovelEngine, key: string): Promise<AudioBuffer | undefined> {
296 const space = await audioBufferSpace(engine);

Callers

nothing calls this directly

Calls 3

audioBufferSpaceFunction · 0.85
serializeAudioBufferFunction · 0.85
setMethod · 0.65

Tested by

no test coverage detected