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

75 lines (74 loc) 1.69 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _custom = require("./custom"); var _utils = require("./utils"); class AudioBufferSourceNode { constructor(context, options) { this.node = options?.pitchCorrection ? new _custom.AudioBufferSourceNodeStretcher(context, options) : new _utils.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; } } exports.default = AudioBufferSourceNode; //# sourceMappingURL=AudioBufferSourceNode.web.js.map