|
|
|
@@ -1,11 +1,15 @@ |
|
|
|
import { Source } from "./Source"; |
|
|
|
import { context } from "../audio"; |
|
|
|
import { context, exposedNumber } from "../audio"; |
|
|
|
|
|
|
|
export class LoopingSource extends Source { |
|
|
|
kind = "Looping"; |
|
|
|
private source!: AudioBufferSourceNode; |
|
|
|
private started = false; |
|
|
|
private running = false; |
|
|
|
|
|
|
|
@exposedNumber("Pitch", 0.25, 4) |
|
|
|
public pitch = 1; |
|
|
|
|
|
|
|
constructor(name: string) { |
|
|
|
super(name); |
|
|
|
} |
|
|
|
@@ -31,5 +35,6 @@ export class LoopingSource extends Source { |
|
|
|
this.source.start(); |
|
|
|
this.running = true; |
|
|
|
} |
|
|
|
this.source.playbackRate.value = this.pitch; |
|
|
|
} |
|
|
|
} |