UNPKG

react-native-audio-api

Version:

react-native-audio-api provides system for controlling audio in React Native environment compatible with Web Audio API specification

70 lines (69 loc) 1.62 kB
"use strict"; import { AudioBufferSourceNodeStretcher } from "./custom/index.js"; import { AudioBufferSourceNodeStandard } from "./utils/index.js"; export default class AudioBufferSourceNode { constructor(context, options) { this.node = options?.pitchCorrection ? new AudioBufferSourceNodeStretcher(context, options) : new AudioBufferSourceNodeStandard(context, options); } connect(destination) { return this.node.connect(destination); } disconnect(destination) { this.node.disconnect(destination); } start(when = 0, offset, duration) { this.node.start(when, offset, duration); } stop(when) { this.node.stop(when); } get onEnded() { return this.node.onEnded; } set onEnded(callback) { this.node.onEnded = callback; } get detune() { return this.node.detune; } get playbackRate() { return this.node.playbackRate; } get buffer() { return this.node.buffer; } set buffer(buffer) { this.node.buffer = buffer; } get loop() { return this.node.loop; } set loop(value) { this.node.loop = value; } get loopStart() { return this.node.loopStart; } set loopStart(value) { this.node.loopStart = value; } get loopEnd() { return this.node.loopEnd; } set loopEnd(value) { this.node.loopEnd = value; } get loopSkip() { return this.node.loopSkip; } set loopSkip(value) { this.node.loopSkip = value; } get onLoopEnded() { return this.node.onLoopEnded; } set onLoopEnded(callback) { this.node.onLoopEnded = callback; } } //# sourceMappingURL=AudioBufferSourceNode.web.js.map