react-native-audio-api
Version:
react-native-audio-api provides system for controlling audio in React Native environment compatible with Web Audio API specification
22 lines (21 loc) • 1.02 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.assertWorkletsEnabled = assertWorkletsEnabled;
exports.clamp = clamp;
var _AudioAPIModule = _interopRequireDefault(require("../AudioAPIModule"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
function assertWorkletsEnabled() {
if (!_AudioAPIModule.default.areWorkletsAvailable) {
throw new Error('[react-native-audio-api]: Worklets are not available. Please install react-native-worklets to use this feature.');
}
if (!_AudioAPIModule.default.isWorkletsVersionSupported) {
throw new Error(`[react-native-audio-api]: Worklets version ${_AudioAPIModule.default.workletsVersion} is not supported.
Please install react-native-worklets of one of the following versions: [${_AudioAPIModule.default.supportedWorkletsVersion.join(', ')}] to use this feature.`);
}
}
function clamp(value, min, max) {
return Math.min(Math.max(value, min), max);
}
//# sourceMappingURL=index.js.map