(id: string, type: string, data: Record<string, any>)
| 61 | |
| 62 | |
| 63 | export function createAudioNode(id: string, type: string, data: Record<string, any>) { |
| 64 | switch (type) { |
| 65 | case 'osc': { |
| 66 | const node = context.createOscillator(); |
| 67 | node.frequency.value = data.frequency; |
| 68 | node.type = data.type; |
| 69 | node.start(); |
| 70 | |
| 71 | nodes.set(id, node); |
| 72 | break; |
| 73 | } |
| 74 | |
| 75 | case 'volume': { |
| 76 | const node = context.createGain(); |
| 77 | node.gain.value = data.gain; |
| 78 | |
| 79 | nodes.set(id, node); |
| 80 | break; |
| 81 | } |
| 82 | } |
| 83 | } |
no outgoing calls
no test coverage detected