(engine: VisualNovelEngine, key: string, buffer: AudioBuffer)
| 278 | } |
| 279 | |
| 280 | export 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 | |
| 295 | export async function getAudioBufferPersistent(engine: VisualNovelEngine, key: string): Promise<AudioBuffer | undefined> { |
| 296 | const space = await audioBufferSpace(engine); |
nothing calls this directly
no test coverage detected