burns-audio-wam
Version:
Collection of Web Audio Modules (WAMs) by Burns Audio
117 lines (85 loc) • 636 kB
JavaScript
/*
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file in the browser devtools.
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
* or disable the default devtool with "devtool: false".
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
*/
/******/ var __webpack_modules__ = ({
/***/ "./node_modules/css-loader/dist/runtime/api.js":
/*!*****************************************************!*\
!*** ./node_modules/css-loader/dist/runtime/api.js ***!
\*****************************************************/
/***/ ((module) => {
eval("\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\nmodule.exports = function (cssWithMappingToString) {\n var list = []; // return the list of modules as css string\n\n list.toString = function toString() {\n return this.map(function (item) {\n var content = \"\";\n var needLayer = typeof item[5] !== \"undefined\";\n\n if (item[4]) {\n content += \"@supports (\".concat(item[4], \") {\");\n }\n\n if (item[2]) {\n content += \"@media \".concat(item[2], \" {\");\n }\n\n if (needLayer) {\n content += \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\");\n }\n\n content += cssWithMappingToString(item);\n\n if (needLayer) {\n content += \"}\";\n }\n\n if (item[2]) {\n content += \"}\";\n }\n\n if (item[4]) {\n content += \"}\";\n }\n\n return content;\n }).join(\"\");\n }; // import a list of modules into the list\n\n\n list.i = function i(modules, media, dedupe, supports, layer) {\n if (typeof modules === \"string\") {\n modules = [[null, modules, undefined]];\n }\n\n var alreadyImportedModules = {};\n\n if (dedupe) {\n for (var k = 0; k < this.length; k++) {\n var id = this[k][0];\n\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n\n for (var _k = 0; _k < modules.length; _k++) {\n var item = [].concat(modules[_k]);\n\n if (dedupe && alreadyImportedModules[item[0]]) {\n continue;\n }\n\n if (typeof layer !== \"undefined\") {\n if (typeof item[5] === \"undefined\") {\n item[5] = layer;\n } else {\n item[1] = \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\").concat(item[1], \"}\");\n item[5] = layer;\n }\n }\n\n if (media) {\n if (!item[2]) {\n item[2] = media;\n } else {\n item[1] = \"@media \".concat(item[2], \" {\").concat(item[1], \"}\");\n item[2] = media;\n }\n }\n\n if (supports) {\n if (!item[4]) {\n item[4] = \"\".concat(supports);\n } else {\n item[1] = \"@supports (\".concat(item[4], \") {\").concat(item[1], \"}\");\n item[4] = supports;\n }\n }\n\n list.push(item);\n }\n };\n\n return list;\n};\n\n//# sourceURL=webpack://audio_track/./node_modules/css-loader/dist/runtime/api.js?");
/***/ }),
/***/ "./node_modules/css-loader/dist/runtime/noSourceMaps.js":
/*!**************************************************************!*\
!*** ./node_modules/css-loader/dist/runtime/noSourceMaps.js ***!
\**************************************************************/
/***/ ((module) => {
eval("\n\nmodule.exports = function (i) {\n return i[1];\n};\n\n//# sourceURL=webpack://audio_track/./node_modules/css-loader/dist/runtime/noSourceMaps.js?");
/***/ }),
/***/ "./src/views/AudioRecorderView.scss":
/*!******************************************!*\
!*** ./src/views/AudioRecorderView.scss ***!
\******************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../node_modules/css-loader/dist/runtime/noSourceMaps.js */ \"./node_modules/css-loader/dist/runtime/noSourceMaps.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../node_modules/css-loader/dist/runtime/api.js */ \"./node_modules/css-loader/dist/runtime/api.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);\n// Imports\n\n\nvar ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".H2pBr3SwzsTRMsFzMlid {\\n padding: 5px;\\n border: 1px solid;\\n border-radius: 5%;\\n margin: 5px;\\n font-weight: bold;\\n}\\n\\n.WBHD1s7m36k7nUrpNC3E {\\n overflow-y: scroll;\\n height: 100%;\\n width: 100%;\\n background-color: #190933;\\n}\", \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"Button\": \"H2pBr3SwzsTRMsFzMlid\",\n\t\"Wrapper\": \"WBHD1s7m36k7nUrpNC3E\"\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);\n\n\n//# sourceURL=webpack://audio_track/./src/views/AudioRecorderView.scss?");
/***/ }),
/***/ "./src/views/WaveformEditorView.scss":
/*!*******************************************!*\
!*** ./src/views/WaveformEditorView.scss ***!
\*******************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../node_modules/css-loader/dist/runtime/noSourceMaps.js */ \"./node_modules/css-loader/dist/runtime/noSourceMaps.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../node_modules/css-loader/dist/runtime/api.js */ \"./node_modules/css-loader/dist/runtime/api.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);\n// Imports\n\n\nvar ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".cNXkJEnbG_kERvayeLqk {\\n background-color: yellow;\\n}\", \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"default\": \"cNXkJEnbG_kERvayeLqk\"\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);\n\n\n//# sourceURL=webpack://audio_track/./src/views/WaveformEditorView.scss?");
/***/ }),
/***/ "./node_modules/preact/dist/preact.module.js":
/*!***************************************************!*\
!*** ./node_modules/preact/dist/preact.module.js ***!
\***************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Component: () => (/* binding */ _),\n/* harmony export */ Fragment: () => (/* binding */ d),\n/* harmony export */ cloneElement: () => (/* binding */ B),\n/* harmony export */ createContext: () => (/* binding */ D),\n/* harmony export */ createElement: () => (/* binding */ v),\n/* harmony export */ createRef: () => (/* binding */ p),\n/* harmony export */ h: () => (/* binding */ v),\n/* harmony export */ hydrate: () => (/* binding */ q),\n/* harmony export */ isValidElement: () => (/* binding */ i),\n/* harmony export */ options: () => (/* binding */ l),\n/* harmony export */ render: () => (/* binding */ S),\n/* harmony export */ toChildArray: () => (/* binding */ A)\n/* harmony export */ });\nvar n,l,u,i,t,o,r,f,e={},c=[],s=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function a(n,l){for(var u in l)n[u]=l[u];return n}function h(n){var l=n.parentNode;l&&l.removeChild(n)}function v(l,u,i){var t,o,r,f={};for(r in u)\"key\"==r?t=u[r]:\"ref\"==r?o=u[r]:f[r]=u[r];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):i),\"function\"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===f[r]&&(f[r]=l.defaultProps[r]);return y(l,f,t,o,null)}function y(n,i,t,o,r){var f={type:n,props:i,key:t,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++u:r};return null!=l.vnode&&l.vnode(f),f}function p(){return{current:null}}function d(n){return n.children}function _(n,l){this.props=n,this.context=l}function k(n,l){if(null==l)return n.__?k(n.__,n.__.__k.indexOf(n)+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return\"function\"==typeof n.type?k(n):null}function b(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return b(n)}}function m(n){(!n.__d&&(n.__d=!0)&&t.push(n)&&!g.__r++||r!==l.debounceRendering)&&((r=l.debounceRendering)||o)(g)}function g(){for(var n;g.__r=t.length;)n=t.sort(function(n,l){return n.__v.__b-l.__v.__b}),t=[],n.some(function(n){var l,u,i,t,o,r;n.__d&&(o=(t=(l=n).__v).__e,(r=l.__P)&&(u=[],(i=a({},t)).__v=t.__v+1,j(r,t,i,l.__n,void 0!==r.ownerSVGElement,null!=t.__h?[o]:null,u,null==o?k(t):o,t.__h),z(u,t),t.__e!=o&&b(t)))})}function w(n,l,u,i,t,o,r,f,s,a){var h,v,p,_,b,m,g,w=i&&i.__k||c,A=w.length;for(u.__k=[],h=0;h<l.length;h++)if(null!=(_=u.__k[h]=null==(_=l[h])||\"boolean\"==typeof _?null:\"string\"==typeof _||\"number\"==typeof _||\"bigint\"==typeof _?y(null,_,null,null,_):Array.isArray(_)?y(d,{children:_},null,null,null):_.__b>0?y(_.type,_.props,_.key,null,_.__v):_)){if(_.__=u,_.__b=u.__b+1,null===(p=w[h])||p&&_.key==p.key&&_.type===p.type)w[h]=void 0;else for(v=0;v<A;v++){if((p=w[v])&&_.key==p.key&&_.type===p.type){w[v]=void 0;break}p=null}j(n,_,p=p||e,t,o,r,f,s,a),b=_.__e,(v=_.ref)&&p.ref!=v&&(g||(g=[]),p.ref&&g.push(p.ref,null,_),g.push(v,_.__c||b,_)),null!=b?(null==m&&(m=b),\"function\"==typeof _.type&&null!=_.__k&&_.__k===p.__k?_.__d=s=x(_,s,n):s=P(n,_,p,w,b,s),a||\"option\"!==u.type?\"function\"==typeof u.type&&(u.__d=s):n.value=\"\"):s&&p.__e==s&&s.parentNode!=n&&(s=k(p))}for(u.__e=m,h=A;h--;)null!=w[h]&&(\"function\"==typeof u.type&&null!=w[h].__e&&w[h].__e==u.__d&&(u.__d=k(i,h+1)),N(w[h],w[h]));if(g)for(h=0;h<g.length;h++)M(g[h],g[++h],g[++h])}function x(n,l,u){var i,t;for(i=0;i<n.__k.length;i++)(t=n.__k[i])&&(t.__=n,l=\"function\"==typeof t.type?x(t,l,u):P(u,t,t,n.__k,t.__e,l));return l}function A(n,l){return l=l||[],null==n||\"boolean\"==typeof n||(Array.isArray(n)?n.some(function(n){A(n,l)}):l.push(n)),l}function P(n,l,u,i,t,o){var r,f,e;if(void 0!==l.__d)r=l.__d,l.__d=void 0;else if(null==u||t!=o||null==t.parentNode)n:if(null==o||o.parentNode!==n)n.appendChild(t),r=null;else{for(f=o,e=0;(f=f.nextSibling)&&e<i.length;e+=2)if(f==t)break n;n.insertBefore(t,o),r=o}return void 0!==r?r:t.nextSibling}function C(n,l,u,i,t){var o;for(o in u)\"children\"===o||\"key\"===o||o in l||H(n,o,null,u[o],i);for(o in l)t&&\"function\"!=typeof l[o]||\"children\"===o||\"key\"===o||\"value\"===o||\"checked\"===o||u[o]===l[o]||H(n,o,l[o],u[o],i)}function $(n,l,u){\"-\"===l[0]?n.setProperty(l,u):n[l]=null==u?\"\":\"number\"!=typeof u||s.test(l)?u:u+\"px\"}function H(n,l,u,i,t){var o;n:if(\"style\"===l)if(\"string\"==typeof u)n.style.cssText=u;else{if(\"string\"==typeof i&&(n.style.cssText=i=\"\"),i)for(l in i)u&&l in u||$(n.style,l,\"\");if(u)for(l in u)i&&u[l]===i[l]||$(n.style,l,u[l])}else if(\"o\"===l[0]&&\"n\"===l[1])o=l!==(l=l.replace(/Capture$/,\"\")),l=l.toLowerCase()in n?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+o]=u,u?i||n.addEventListener(l,o?T:I,o):n.removeEventListener(l,o?T:I,o);else if(\"dangerouslySetInnerHTML\"!==l){if(t)l=l.replace(/xlink[H:h]/,\"h\").replace(/sName$/,\"s\");else if(\"href\"!==l&&\"list\"!==l&&\"form\"!==l&&\"tabIndex\"!==l&&\"download\"!==l&&l in n)try{n[l]=null==u?\"\":u;break n}catch(n){}\"function\"==typeof u||(null!=u&&(!1!==u||\"a\"===l[0]&&\"r\"===l[1])?n.setAttribute(l,u):n.removeAttribute(l))}}function I(n){this.l[n.type+!1](l.event?l.event(n):n)}function T(n){this.l[n.type+!0](l.event?l.event(n):n)}function j(n,u,i,t,o,r,f,e,c){var s,h,v,y,p,k,b,m,g,x,A,P=u.type;if(void 0!==u.constructor)return null;null!=i.__h&&(c=i.__h,e=u.__e=i.__e,u.__h=null,r=[e]),(s=l.__b)&&s(u);try{n:if(\"function\"==typeof P){if(m=u.props,g=(s=P.contextType)&&t[s.__c],x=s?g?g.props.value:s.__:t,i.__c?b=(h=u.__c=i.__c).__=h.__E:(\"prototype\"in P&&P.prototype.render?u.__c=h=new P(m,x):(u.__c=h=new _(m,x),h.constructor=P,h.render=O),g&&g.sub(h),h.props=m,h.state||(h.state={}),h.context=x,h.__n=t,v=h.__d=!0,h.__h=[]),null==h.__s&&(h.__s=h.state),null!=P.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=a({},h.__s)),a(h.__s,P.getDerivedStateFromProps(m,h.__s))),y=h.props,p=h.state,v)null==P.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(null==P.getDerivedStateFromProps&&m!==y&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(m,x),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(m,h.__s,x)||u.__v===i.__v){h.props=m,h.state=h.__s,u.__v!==i.__v&&(h.__d=!1),h.__v=u,u.__e=i.__e,u.__k=i.__k,u.__k.forEach(function(n){n&&(n.__=u)}),h.__h.length&&f.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(m,h.__s,x),null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(y,p,k)})}h.context=x,h.props=m,h.state=h.__s,(s=l.__r)&&s(u),h.__d=!1,h.__v=u,h.__P=n,s=h.render(h.props,h.state,h.context),h.state=h.__s,null!=h.getChildContext&&(t=a(a({},t),h.getChildContext())),v||null==h.getSnapshotBeforeUpdate||(k=h.getSnapshotBeforeUpdate(y,p)),A=null!=s&&s.type===d&&null==s.key?s.props.children:s,w(n,Array.isArray(A)?A:[A],u,i,t,o,r,f,e,c),h.base=u.__e,u.__h=null,h.__h.length&&f.push(h),b&&(h.__E=h.__=null),h.__e=!1}else null==r&&u.__v===i.__v?(u.__k=i.__k,u.__e=i.__e):u.__e=L(i.__e,u,i,t,o,r,f,c);(s=l.diffed)&&s(u)}catch(n){u.__v=null,(c||null!=r)&&(u.__e=e,u.__h=!!c,r[r.indexOf(e)]=null),l.__e(n,u,i)}}function z(n,u){l.__c&&l.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u)})}catch(n){l.__e(n,u.__v)}})}function L(l,u,i,t,o,r,f,c){var s,a,v,y=i.props,p=u.props,d=u.type,_=0;if(\"svg\"===d&&(o=!0),null!=r)for(;_<r.length;_++)if((s=r[_])&&(s===l||(d?s.localName==d:3==s.nodeType))){l=s,r[_]=null;break}if(null==l){if(null===d)return document.createTextNode(p);l=o?document.createElementNS(\"http://www.w3.org/2000/svg\",d):document.createElement(d,p.is&&p),r=null,c=!1}if(null===d)y===p||c&&l.data===p||(l.data=p);else{if(r=r&&n.call(l.childNodes),a=(y=i.props||e).dangerouslySetInnerHTML,v=p.dangerouslySetInnerHTML,!c){if(null!=r)for(y={},_=0;_<l.attributes.length;_++)y[l.attributes[_].name]=l.attributes[_].value;(v||a)&&(v&&(a&&v.__html==a.__html||v.__html===l.innerHTML)||(l.innerHTML=v&&v.__html||\"\"))}if(C(l,p,y,o,c),v)u.__k=[];else if(_=u.props.children,w(l,Array.isArray(_)?_:[_],u,i,t,o&&\"foreignObject\"!==d,r,f,r?r[0]:i.__k&&k(i,0),c),null!=r)for(_=r.length;_--;)null!=r[_]&&h(r[_]);c||(\"value\"in p&&void 0!==(_=p.value)&&(_!==l.value||\"progress\"===d&&!_)&&H(l,\"value\",_,y.value,!1),\"checked\"in p&&void 0!==(_=p.checked)&&_!==l.checked&&H(l,\"checked\",_,y.checked,!1))}return l}function M(n,u,i){try{\"function\"==typeof n?n(u):n.current=u}catch(n){l.__e(n,i)}}function N(n,u,i){var t,o;if(l.unmount&&l.unmount(n),(t=n.ref)&&(t.current&&t.current!==n.__e||M(t,null,u)),null!=(t=n.__c)){if(t.componentWillUnmount)try{t.componentWillUnmount()}catch(n){l.__e(n,u)}t.base=t.__P=null}if(t=n.__k)for(o=0;o<t.length;o++)t[o]&&N(t[o],u,\"function\"!=typeof n.type);i||null==n.__e||h(n.__e),n.__e=n.__d=void 0}function O(n,l,u){return this.constructor(n,u)}function S(u,i,t){var o,r,f;l.__&&l.__(u,i),r=(o=\"function\"==typeof t)?null:t&&t.__k||i.__k,f=[],j(i,u=(!o&&t||i).__k=v(d,null,[u]),r||e,e,void 0!==i.ownerSVGElement,!o&&t?[t]:r?null:i.firstChild?n.call(i.childNodes):null,f,!o&&t?t:r?r.__e:i.firstChild,o),z(f,u)}function q(n,l){S(n,l,q)}function B(l,u,i){var t,o,r,f=a({},l.props);for(r in u)\"key\"==r?t=u[r]:\"ref\"==r?o=u[r]:f[r]=u[r];return arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):i),y(l.type,f,t||l.key,o||l.ref,null)}function D(n,l){var u={__c:l=\"__cC\"+f++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var u,i;return this.getChildContext||(u=[],(i={})[l]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.some(m)},this.sub=function(n){u.push(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u.splice(u.indexOf(n),1),l&&l.call(n)}}),n.children}};return u.Provider.__=u.Consumer.contextType=u}n=c.slice,l={__e:function(n,l){for(var u,i,t;l=l.__;)if((u=l.__c)&&!u.__)try{if((i=u.constructor)&&null!=i.getDerivedStateFromError&&(u.setState(i.getDerivedStateFromError(n)),t=u.__d),null!=u.componentDidCatch&&(u.componentDidCatch(n),t=u.__d),t)return u.__E=u}catch(l){n=l}throw n}},u=0,i=function(n){return null!=n&&void 0===n.constructor},_.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=a({},this.state),\"function\"==typeof n&&(n=n(a({},u),this.props)),n&&a(u,n),null!=n&&this.__v&&(l&&this.__h.push(l),m(this))},_.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),m(this))},_.prototype.render=d,t=[],o=\"function\"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,g.__r=0,f=0;\n//# sourceMappingURL=preact.module.js.map\n\n\n//# sourceURL=webpack://audio_track/./node_modules/preact/dist/preact.module.js?");
/***/ }),
/***/ "./src/AudioRecorderNode.ts":
/*!**********************************!*\
!*** ./src/AudioRecorderNode.ts ***!
\**********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AudioRecorderNode: () => (/* binding */ AudioRecorderNode)\n/* harmony export */ });\n/* harmony import */ var _webaudiomodules_sdk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @webaudiomodules/sdk */ \"../../../node_modules/@webaudiomodules/sdk/dist/index.js\");\n/* harmony import */ var _AudioRecorderProcessor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AudioRecorderProcessor */ \"./src/AudioRecorderProcessor.ts\");\n/* harmony import */ var _RecordingBuffer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./RecordingBuffer */ \"./src/RecordingBuffer.ts\");\n/* harmony import */ var _Sample__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Sample */ \"./src/Sample.ts\");\n/* harmony import */ var _SampleEditor__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./SampleEditor */ \"./src/SampleEditor.ts\");\n\n\n\n\n\nfunction token() {\n return Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 16);\n}\nclass AudioRecorderNode extends _webaudiomodules_sdk__WEBPACK_IMPORTED_MODULE_0__.WamNode {\n constructor(module, options) {\n super(module, { ...options, processorOptions: {\n numberOfInputs: 1,\n numberOfOutputs: 1,\n outputChannelCount: [2],\n } });\n this.destroyed = false;\n this.editor = new _SampleEditor__WEBPACK_IMPORTED_MODULE_4__.SampleEditor(this.instanceId, this.context, this.port);\n this.recordingArmed = false;\n this._supportedEventTypes = new Set(['wam-automation', 'wam-transport']);\n }\n static async addModules(audioContext, moduleId) {\n const { audioWorklet } = audioContext;\n await super.addModules(audioContext, moduleId);\n await (0,_webaudiomodules_sdk__WEBPACK_IMPORTED_MODULE_0__.addFunctionModule)(audioWorklet, _AudioRecorderProcessor__WEBPACK_IMPORTED_MODULE_1__[\"default\"], moduleId);\n }\n setRecording(recording) {\n this.port.postMessage({ source: \"ar\", action: \"record\", recording });\n this.recordingArmed = recording;\n if (this.editor.callback) {\n this.editor.callback();\n }\n }\n setMonitor(monitor) {\n this.port.postMessage({ source: \"ar\", action: \"monitor\", monitor });\n this.monitor = monitor;\n if (this.editor.callback) {\n this.editor.callback();\n }\n }\n async getState() {\n let savedAssetUris = this.editor.samples.filter(s => !!s.assetUrl).map(s => {\n var _a;\n return {\n assetUrl: s.assetUrl,\n clipId: s.clipId, settings: (_a = s.clipSettings) !== null && _a !== void 0 ? _a : {\n clipEnabled: true,\n loopEnabled: false,\n startingOffset: 0,\n loopLengthBars: 1,\n loopStartBar: 0\n }\n };\n });\n return {\n samples: savedAssetUris\n };\n }\n async setState(state) {\n if (!state) {\n return;\n }\n if (state.samples !== undefined) {\n let newSampleList = [];\n let currentSamples = [...this.editor.samples];\n for (let sample of state.samples) {\n let existingSample = currentSamples.find(s => s.assetUrl == sample.assetUrl && s.clipId == sample.clipId);\n if (!!existingSample) {\n currentSamples = currentSamples.filter(s => !(s.assetUrl == sample.assetUrl && s.clipId == sample.clipId));\n newSampleList.push(existingSample);\n }\n else {\n let sampleState = {\n token: token(),\n clipId: sample.clipId,\n state: \"INIT\",\n assetUrl: sample.assetUrl,\n zoom: 1,\n name: \"\",\n height: 0,\n clipSettings: sample.settings\n };\n newSampleList.push(sampleState);\n }\n }\n for (let existing of currentSamples) {\n if (!existing.assetUrl) {\n newSampleList.push(existing);\n }\n }\n for (let oldSample of currentSamples) {\n this.port.postMessage({ source: \"ar\", action: \"delete\", clipId: oldSample.clipId, token: oldSample.token });\n }\n for (let sample of newSampleList) {\n this.editor.sendClipSettingsToProcessor(sample);\n }\n this.editor.setState({ samples: newSampleList });\n }\n }\n _onMessage(message) {\n if (message.data && message.data.source == \"ar\") {\n if (message.data.action == \"transport\") {\n this.transport = message.data.transport;\n }\n if (message.data.action == \"finalize\") {\n if (this.recordingBuffer && this.recordingBuffer.channels.length > 0) {\n let sample = {\n clipId: message.data.clipId,\n token: token(),\n height: 150,\n state: \"LOADED\",\n sample: new _Sample__WEBPACK_IMPORTED_MODULE_3__.Sample(this.context, this.recordingBuffer.render(this.context)),\n name: `Sample ${this.editor.samples.length + 1}`,\n zoom: 1,\n clipSettings: {\n clipEnabled: true,\n loopEnabled: false,\n loopLengthBars: 1,\n loopStartBar: 0,\n startingOffset: 0,\n }\n };\n this.editor.samples.push(sample);\n this.editor.sendSampleToProcessor(sample);\n }\n this.recordingBuffer = undefined;\n if (this.editor.callback) {\n this.editor.callback();\n }\n }\n if (message.data.buffer) {\n let { startSample, endSample, channels } = message.data.buffer;\n if (!this.recordingBuffer) {\n this.recordingBuffer = new _RecordingBuffer__WEBPACK_IMPORTED_MODULE_2__.RecordingBuffer(channels.length);\n if (this.editor.callback) {\n this.editor.callback();\n }\n }\n this.recordingBuffer.append(startSample, endSample, channels);\n }\n }\n else {\n super._onMessage(message);\n }\n }\n}\n\n\n//# sourceURL=webpack://audio_track/./src/AudioRecorderNode.ts?");
/***/ }),
/***/ "./src/AudioRecorderProcessor.ts":
/*!***************************************!*\
!*** ./src/AudioRecorderProcessor.ts ***!
\***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\nconst getAudioRecorderProcessor = (moduleId) => {\n const audioWorkletGlobalScope = globalThis;\n const { registerProcessor } = audioWorkletGlobalScope;\n const ModuleScope = audioWorkletGlobalScope.webAudioModules.getModuleScope(moduleId);\n const WamProcessor = ModuleScope.WamProcessor;\n class AudioClip {\n constructor(token, channels) {\n this.token = token;\n this.channels = channels;\n this.clipSettings = {\n clipEnabled: false,\n loopEnabled: false,\n startingOffset: 0,\n loopStartBar: 0,\n loopLengthBars: 8,\n };\n }\n setClipSettings(settings) {\n this.clipSettings = settings;\n }\n writeInto(transport, playhead, startSample, endSample, output) {\n const { sampleRate } = audioWorkletGlobalScope;\n if (!this.clipSettings.clipEnabled || this.channels.length == 0 || this.channels[0].length == 0) {\n return;\n }\n if (this.clipSettings.loopEnabled) {\n const loopStartTime = (this.clipSettings.loopStartBar * transport.timeSigNumerator) * 60 / transport.tempo;\n const loopStartSample = this.clipSettings.startingOffset + Math.floor(loopStartTime * sampleRate);\n const loopLength = (this.clipSettings.loopLengthBars * transport.timeSigNumerator) * 60 / transport.tempo;\n const loopLengthSamples = Math.floor(loopLength);\n for (let chan = 0; chan < output.length; chan++) {\n let pos = loopStartSample + (playhead % loopLengthSamples);\n let readChan = chan % this.channels.length;\n for (let i = startSample; i <= endSample; i++) {\n if (pos < this.channels[readChan].length) {\n output[chan][i] += this.channels[readChan][pos];\n }\n pos++;\n if (pos > loopStartSample + loopLengthSamples) {\n pos = loopStartSample + (playhead % loopLengthSamples);\n }\n }\n }\n }\n else {\n playhead += this.clipSettings.startingOffset;\n if (playhead > this.channels[0].length) {\n return;\n }\n for (let chan = 0; chan < output.length; chan++) {\n let pos = playhead;\n let readChan = chan % this.channels.length;\n for (let i = startSample; i <= endSample; i++) {\n output[chan][i] += this.channels[readChan][pos];\n pos++;\n if (pos > this.channels[0].length) {\n i = endSample;\n }\n }\n }\n }\n }\n }\n class AudioRecorderProcessor extends WamProcessor {\n constructor(options) {\n super(options);\n const { moduleId, instanceId, } = options.processorOptions;\n this.recordingArmed = false;\n this.monitor = false;\n this.clips = new Map();\n super.port.start();\n }\n startRecording() {\n this.recordingArmed = true;\n }\n stopRecording() {\n this.recordingArmed = false;\n }\n finalizeSample() {\n console.log(\"Finalizing sample\");\n this.port.postMessage({ source: \"ar\", clipId: this.currentClipId, action: \"finalize\" });\n }\n _process(startSample, endSample, inputs, outputs) {\n var _a;\n let channels = inputs[0];\n if (this.monitor) {\n for (let i = 0; i < inputs.length; i++) {\n for (let j = 0; j < inputs[i].length; j++) {\n for (let k = 0; k < inputs[i][j].length; k++) {\n outputs[i][j][k] = inputs[i][j][k];\n }\n }\n }\n }\n if (!this.transportData || !this.transportData.playing) {\n if (this.recordingActive) {\n this.finalizeSample();\n this.recordingActive = false;\n }\n this.playing = false;\n return;\n }\n let { currentTime } = audioWorkletGlobalScope;\n if (this.transportData.currentBarStarted > currentTime) {\n return;\n }\n var timeElapsed = currentTime - this.transportData.currentBarStarted;\n var beatPosition = (this.transportData.currentBar * this.transportData.timeSigNumerator) + ((this.transportData.tempo / 60.0) * timeElapsed);\n var currentBar = Math.floor(beatPosition / this.transportData.timeSigNumerator);\n if (!this.playing) {\n this.playing = true;\n this.samplesElapsed = 0;\n if (this.pendingClipId) {\n this.currentClipId = this.pendingClipId;\n this.pendingClipId = undefined;\n }\n if (this.recordingArmed) {\n this.recordingActive = true;\n }\n this.lastBar = currentBar;\n }\n if (currentBar != this.lastBar) {\n let recordingJustStarted = false;\n if (this.recordingActive && !this.recordingArmed) {\n this.finalizeSample();\n this.recordingActive = false;\n }\n if (!this.recordingActive && this.recordingArmed) {\n this.recordingActive = true;\n recordingJustStarted = true;\n }\n if (this.pendingClipId) {\n if (this.recordingActive && !recordingJustStarted) {\n this.finalizeSample();\n }\n this.currentClipId = this.pendingClipId;\n this.pendingClipId = undefined;\n }\n this.lastBar = currentBar;\n }\n if (this.recordingActive && channels.length > 0) {\n let copy = channels.map(c => {\n let result = new Float32Array(c.length);\n for (let j = 0; j < c.length; j++) {\n result[j] = c[j];\n }\n return result;\n });\n this.port.postMessage({ source: \"ar\", clipId: this.currentClipId, buffer: { startSample, endSample, channels: copy } });\n }\n if (!this.recordingActive) {\n let clips = (_a = this.clips.get(this.currentClipId)) !== null && _a !== void 0 ? _a : [];\n for (let take of clips) {\n take.writeInto(this.transportData, this.samplesElapsed, startSample, endSample, outputs[0]);\n }\n this.samplesElapsed += (endSample - startSample);\n }\n return;\n }\n _onMidi(midiData) {\n }\n _onTransport(transportData) {\n this.transportData = transportData;\n super.port.postMessage({\n source: \"ar\",\n action: \"transport\",\n transport: transportData\n });\n }\n async _onMessage(message) {\n if (message.data && message.data.source == \"ar\") {\n if (message.data.action == \"record\") {\n console.log(\"Received recording message: \", message.data);\n if (message.data.recording) {\n this.startRecording();\n }\n else {\n this.stopRecording();\n }\n }\n if (message.data.action == \"monitor\") {\n this.monitor = message.data.monitor;\n }\n if (message.data.action == \"load\") {\n console.log(\"Received track load: \", message.data);\n let newClip = new AudioClip(message.data.token, message.data.buffer);\n newClip.setClipSettings(message.data.settings);\n if (!this.clips.get(message.data.clipId)) {\n this.clips.set(message.data.clipId, []);\n }\n this.clips.get(message.data.clipId).push(newClip);\n }\n else if (message.data.action == \"delete\") {\n console.log(\"Processor removing track \", message.data.token, \"on clip \", message.data.clipId);\n let existing = this.clips.get(message.data.clipId);\n if (!existing) {\n return;\n }\n existing = existing.filter(s => s.token !== message.data.token);\n this.clips.set(message.data.clipId, existing);\n }\n else if (message.data.action == \"play\") {\n console.log(\"received play message for clipId %s\", message.data.clipId);\n this.pendingClipId = message.data.clipId;\n }\n else if (message.data.action == \"clipSettings\") {\n console.log(\"Received clip settings for track %s\", message.data.token);\n let clip = this.clips.get(message.data.clipId);\n if (!clip) {\n return;\n }\n let existing = clip.find(take => take.token == message.data.token);\n if (existing) {\n existing.setClipSettings(message.data.clipSettings);\n }\n }\n }\n else {\n super._onMessage(message);\n }\n }\n }\n try {\n registerProcessor('com.sequencerParty.audioTrack', AudioRecorderProcessor);\n }\n catch (error) {\n }\n return AudioRecorderProcessor;\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getAudioRecorderProcessor);\n\n\n//# sourceURL=webpack://audio_track/./src/AudioRecorderProcessor.ts?");
/***/ }),
/***/ "./src/RecordingBuffer.ts":
/*!********************************!*\
!*** ./src/RecordingBuffer.ts ***!
\********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ RecordingBuffer: () => (/* binding */ RecordingBuffer)\n/* harmony export */ });\nclass RecordingBuffer {\n constructor(channels) {\n this.channels = new Array(channels);\n for (let i = 0; i < channels; i++) {\n this.channels[i] = [];\n }\n this.length = 0;\n }\n append(startSample, endSample, channels) {\n for (let i = 0; i < channels.length; i++) {\n this.channels[i].push(channels[i].slice(startSample, endSample));\n }\n this.length += (endSample - startSample);\n }\n render(context) {\n let latency;\n if (context.outputLatency && context.outputLatency > 0) {\n latency = context.outputLatency;\n }\n else {\n latency = context.baseLatency;\n }\n let skipSamples = latency * context.sampleRate;\n console.log(\"Trimming \", skipSamples);\n if (this.length <= skipSamples) {\n throw new Error(\"No content left after trimming the latency samples!\");\n }\n this.length -= skipSamples;\n var buffer = context.createBuffer(this.channels.length, this.length, context.sampleRate);\n for (let ch = 0; ch < this.channels.length; ch++) {\n let buf = buffer.getChannelData(ch);\n let bufPos = 0;\n for (let idx = 0; idx < this.channels[ch].length; idx++) {\n for (let pos = 0; pos < this.channels[ch][idx].length; pos++) {\n if (skipSamples > 0) {\n skipSamples--;\n }\n else {\n buf[bufPos++] = this.channels[ch][idx][pos];\n }\n }\n }\n }\n return buffer;\n }\n}\n\n\n//# sourceURL=webpack://audio_track/./src/RecordingBuffer.ts?");
/***/ }),
/***/ "./src/Resizer.tsx":
/*!*************************!*\
!*** ./src/Resizer.tsx ***!
\*************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Resizer: () => (/* binding */ Resizer)\n/* harmony export */ });\n/* harmony import */ var preact__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! preact */ \"./node_modules/preact/dist/preact.module.js\");\n\nclass Resizer extends preact__WEBPACK_IMPORTED_MODULE_0__.Component {\n constructor() {\n super();\n this.resizeMoveHandler = this.resizeMoveHandler.bind(this);\n this.resizeUpHandler = this.resizeUpHandler.bind(this);\n }\n componentWillUnmount() {\n window.removeEventListener(\"mousemove\", this.resizeMoveHandler);\n window.removeEventListener(\"mouseup\", this.resizeUpHandler);\n }\n async resizeMoveHandler(e) {\n let width = (this.props.vertical == true) ? this.parent.getBoundingClientRect().left : e.pageX - this.parent.getBoundingClientRect().left;\n let height = e.pageY - this.parent.getBoundingClientRect().top;\n this.props.resize(width, height);\n }\n async resizeUpHandler(e) {\n document.body.style.cursor = \"default\";\n this.props.finished();\n window.removeEventListener(\"mousemove\", this.resizeMoveHandler);\n window.removeEventListener(\"mouseup\", this.resizeUpHandler);\n }\n resizeMouseDown(evt) {\n if (!evt.target) {\n return;\n }\n this.parent = evt.target.parentNode;\n if (!this.parent) {\n return;\n }\n if (this.props.vertical) {\n document.body.style.cursor = \"ns-resize\";\n }\n else {\n document.body.style.cursor = \"nwse-resize\";\n }\n this.props.resize(this.parent.clientWidth, this.parent.clientHeight);\n window.addEventListener(\"mousemove\", this.resizeMoveHandler);\n window.addEventListener(\"mouseup\", this.resizeUpHandler);\n }\n render() {\n if (this.props.vertical) {\n return (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(\"div\", { style: \"background-color: rgba(107, 114, 128, 100); width: 100%; height: 8px; cursor: ns-resize;\", onMouseDown: (e) => this.resizeMouseDown(e) });\n }\n else {\n return (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(\"div\", { style: \"position: absolute; bottom: 0px; right: 0px; background-color: rgba(107, 114, 128, 100); width: 8px; height: 8px; cursor: nwse-resize;\", onMouseDown: (e) => this.resizeMouseDown(e) });\n }\n }\n}\n\n\n//# sourceURL=webpack://audio_track/./src/Resizer.tsx?");
/***/ }),
/***/ "./src/Sample.ts":
/*!***********************!*\
!*** ./src/Sample.ts ***!
\***********************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Sample: () => (/* binding */ Sample)\n/* harmony export */ });\n/* harmony import */ var wavefile__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! wavefile */ \"./node_modules/wavefile/index.js\");\n\nvar debug = console.log;\nclass Sample {\n constructor(context, buffer) {\n this.context = context;\n this.buffer = buffer;\n }\n saveWav(bitDepth) {\n let wav = new wavefile__WEBPACK_IMPORTED_MODULE_0__.WaveFile();\n let channels = [];\n for (let i = 0; i < this.buffer.numberOfChannels; i++) {\n channels.push(this.buffer.getChannelData(i));\n }\n wav.fromScratch(this.buffer.numberOfChannels, this.buffer.sampleRate, \"32f\", channels);\n return new Blob([wav.toBuffer()], { type: \"audio/wave\" });\n }\n absPeak() {\n let peak = 0;\n for (let i = 0; i < this.buffer.numberOfChannels; i++) {\n let buf = this.buffer.getChannelData(i);\n for (let j = 0; j < buf.length; j++) {\n if (Math.abs(buf[j]) > peak) {\n peak = Math.abs(buf[j]);\n }\n }\n }\n return peak;\n }\n amplify(factor) {\n let scaledBuffer = this.context.createBuffer(this.buffer.numberOfChannels, this.buffer.length, this.buffer.sampleRate);\n for (let i = 0; i < this.buffer.numberOfChannels; i++) {\n let src = this.buffer.getChannelData(i);\n let dst = scaledBuffer.getChannelData(i);\n for (let j = 0; j < src.length; j++) {\n dst[j] = src[j] * factor;\n }\n }\n return new Sample(this.context, scaledBuffer);\n }\n trimLeft(pos) {\n let startPos = Math.floor(this.buffer.length * pos);\n let length = this.buffer.length - startPos;\n let trimmed = this.context.createBuffer(this.buffer.numberOfChannels, length, this.buffer.sampleRate);\n for (let i = 0; i < this.buffer.numberOfChannels; i++) {\n let src = this.buffer.getChannelData(i);\n let dst = trimmed.getChannelData(i);\n for (let j = 0; j < dst.length; j++) {\n dst[j] = src[startPos + j];\n }\n }\n return new Sample(this.context, trimmed);\n }\n trimRight(pos) {\n let length = Math.floor(this.buffer.length * pos);\n let trimmed = this.context.createBuffer(this.buffer.numberOfChannels, length, this.buffer.sampleRate);\n for (let i = 0; i < this.buffer.numberOfChannels; i++) {\n let src = this.buffer.getChannelData(i);\n let dst = trimmed.getChannelData(i);\n for (let j = 0; j < length; j++) {\n dst[j] = src[j];\n }\n }\n return new Sample(this.context, trimmed);\n }\n fadeOut(pos) {\n let startPos = Math.floor(this.buffer.length * pos);\n let fadeLength = this.buffer.length - startPos;\n let faded = this.context.createBuffer(this.buffer.numberOfChannels, this.buffer.length, this.buffer.sampleRate);\n for (let i = 0; i < this.buffer.numberOfChannels; i++) {\n let src = this.buffer.getChannelData(i);\n let dst = faded.getChannelData(i);\n for (let j = 0; j < length; j++) {\n if (j < startPos) {\n dst[j] = src[j];\n }\n else {\n let fadeAmt = (j - startPos) / fadeLength;\n fadeAmt = fadeAmt * fadeAmt;\n dst[j] = src[j] * (1.0 - fadeAmt);\n }\n }\n }\n return new Sample(this.context, faded);\n }\n fadeIn(pos) {\n let endPos = Math.floor(this.buffer.length * pos);\n let faded = this.context.createBuffer(this.buffer.numberOfChannels, this.buffer.length, this.buffer.sampleRate);\n for (let i = 0; i < this.buffer.numberOfChannels; i++) {\n let src = this.buffer.getChannelData(i);\n let dst = faded.getChannelData(i);\n for (let j = 0; j < length; j++) {\n if (j < endPos) {\n let fadeAmt = 1 - ((endPos - j) / endPos);\n fadeAmt = fadeAmt * fadeAmt;\n dst[j] = src[j] * fadeAmt;\n }\n else {\n dst[j] = src[j];\n }\n }\n }\n return new Sample(this.context, faded);\n }\n splitChannels() {\n let output = [];\n for (let i = 0; i < this.buffer.numberOfChannels; i++) {\n let split = this.context.createBuffer(1, this.buffer.length, this.buffer.sampleRate);\n let inp = this.buffer.getChannelData(i);\n let out = split.getChannelData(0);\n for (let j = 0; j < inp.length; j++) {\n out[j] = inp[j];\n }\n output.push(new Sample(this.context, split));\n }\n debug(`splitChannels returning ${output.length} samples`);\n return output;\n }\n split(sections) {\n let output = [];\n for (let section of sections) {\n let startPos = Math.floor(this.buffer.length * section.start);\n let endPos = Math.floor(this.buffer.length * section.end);\n let length = endPos - startPos;\n if (length < 1) {\n throw new Error(\"Section end must be after section start\");\n }\n let segment = this.context.createBuffer(this.buffer.numberOfChannels, length, this.buffer.sampleRate);\n for (let i = 0; i < this.buffer.numberOfChannels; i++) {\n let inp = this.buffer.getChannelData(i);\n let out = segment.getChannelData(0);\n for (let i = 0; i < length; i++) {\n out[i] = inp[startPos + i];\n }\n output.push(new Sample(this.context, segment));\n }\n }\n return output;\n }\n}\n\n\n//# sourceURL=webpack://audio_track/./src/Sample.ts?");
/***/ }),
/***/ "./src/SampleEditor.ts":
/*!*****************************!*\
!*** ./src/SampleEditor.ts ***!
\*****************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SampleEditor: () => (/* binding */ SampleEditor)\n/* harmony export */ });\n/* harmony import */ var _Sample__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Sample */ \"./src/Sample.ts\");\n\nclass SampleEditor {\n constructor(instanceId, context, port) {\n this.context = context;\n this.instanceId = instanceId;\n th