element-web-synapse01pim.gr.jp

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

recorder.worklet.js.map (24084B)


      1 {"version":3,"file":"recorder.worklet.js","mappings":"mBAAA,SAAAA,EAAAC,GAGA,OAAAD,EAAA,mBAAAE,QAAA,iBAAAA,OAAAC,SAAA,SAAAF,GACA,cAAAA,CACA,EAAI,SAAAA,GACJ,OAAAA,GAAA,mBAAAC,QAAAD,EAAAG,cAAAF,QAAAD,IAAAC,OAAAG,UAAA,gBAAAJ,CACA,EAAGD,EAAAC,EACH,CCNA,SAAAK,EAAAC,GACA,IAAAC,ECFA,SAAAD,EAAAE,GACA,aAAkBT,EAAOO,KAAAA,EAAA,OAAAA,EACzB,IAAAG,EAAAH,EAAAL,OAAAS,aACA,YAAAD,EAAA,CACA,IAAAF,EAAAE,EAAAE,KAAAL,EAAAE,GAAA,WACA,aAAoBT,EAAOQ,GAAA,OAAAA,EAC3B,UAAAK,UAAA,+CACA,CACA,kBAAAJ,EAAAK,OAAAC,QAAAR,EACA,CDPUI,CAAWJ,EAAA,UACrB,gBAAqBP,EAAOQ,GAAAA,EAAAA,EAAA,EAC5B,CEJA,SAAAQ,EAAAN,EAAAD,EAAAF,GACA,OAAAE,EAAcH,EAAaG,MAAAC,EAAAO,OAAAC,eAAAR,EAAAD,EAAA,CAC3BU,MAAAZ,EACAa,YAAA,EACAC,cAAA,EACAC,UAAA,IACGZ,EAAAD,GAAAF,EAAAG,CACH,CCKA,SAAAF,EAAAE,EAAAH,EAAAgB,GACA,IAAAd,GAAAC,EAAAH,IAAAgB,EAAAhB,GACA,OAAAQ,OAAAS,MAAAf,GAAA,EAAAA,CACA,CCyFO,SAASgB,EAAaC,EAAQC,GAGjC,OAAO,IAAIC,MAASD,GAAQE,KAAKH,EACrC,CCjGO,IAAKI,EAAY,SAAZA,GAAY,OAAZA,EAAY,oBAAZA,EAAY,+BAAZA,CAAY,MAqBQL,EAAU,EADD,ICRzC,SAASM,EAAsBC,GAE3B,OAAOC,KAAKC,MAJmB,IAIZF,EAAUjB,OAAOoB,UAJL,EAKnC,CAOA,MAAMC,UAAuBC,sBAAsBjC,WAAAA,IAAAkC,GAAAC,SAAAD,GAAAtB,EAAAwB,KAAA,sBACjB,GAACxB,EAAAwB,KAAA,iBACN,EAAC,CAEnBC,OAAAA,CACHC,EACAC,EACAC,GAEA,MAAMC,EAAgBd,EAAsBe,aAO5C,GAAID,IAAkBL,KAAKO,qBAAoD,IAA7BP,KAAKO,oBAA2B,CAG9E,MAAMC,EAAWN,EAAO,GAAG,GAOrBO,EAAShB,KAAKiB,OAAOF,GAErBG,EAAYC,EADHnB,KAAKoB,OAAOL,IACa,EAAG,GAAKI,EAAaH,GAAS,EAAG,GAEzET,KAAKc,KAAKC,YAA+B,CACrCC,GAAI1B,EAAa2B,cACjBN,UAAWA,EACXO,SAAUlB,KAAKmB,mBAEnBnB,KAAKO,oBAtCNhB,EAsCkDc,EAtCX,EATf,GAgD3B,CAQA,OALAL,KAAKc,KAAKC,YAA4B,CAAEC,GAAI1B,EAAa8B,SAAUC,YAAaf,eAKzE,CACX,EAGJgB,kBDxE4B,mBCwEI1B","sources":["webpack://element-web/javascript/node_modules/.pnpm/source-map-loader@5.0.0_webpack@5.108.4/node_modules/source-map-loader/dist/node_modules/.pnpm/@babel+runtime@7.29.7/node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://element-web/javascript/node_modules/.pnpm/source-map-loader@5.0.0_webpack@5.108.4/node_modules/source-map-loader/dist/node_modules/.pnpm/@babel+runtime@7.29.7/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://element-web/javascript/node_modules/.pnpm/source-map-loader@5.0.0_webpack@5.108.4/node_modules/source-map-loader/dist/node_modules/.pnpm/@babel+runtime@7.29.7/node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://element-web/javascript/node_modules/.pnpm/source-map-loader@5.0.0_webpack@5.108.4/node_modules/source-map-loader/dist/node_modules/.pnpm/@babel+runtime@7.29.7/node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://element-web/javascript/node_modules/.pnpm/source-map-loader@5.0.0_webpack@5.108.4/node_modules/source-map-loader/dist/packages/shared-components/dist/numbers.js","webpack://element-web/./src/utils/arrays.ts","webpack://element-web/./src/audio/consts.ts","webpack://element-web/./src/audio/RecorderWorklet.ts"],"sourcesContent":["function _typeof(o) {\n  \"@babel/helpers - typeof\";\n\n  return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n    return typeof o;\n  } : function (o) {\n    return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n  }, _typeof(o);\n}\nexport { _typeof as default };","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nfunction toPropertyKey(t) {\n  var i = toPrimitive(t, \"string\");\n  return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nexport { toPropertyKey as default };","import _typeof from \"./typeof.js\";\nfunction toPrimitive(t, r) {\n  if (\"object\" != _typeof(t) || !t) return t;\n  var e = t[Symbol.toPrimitive];\n  if (void 0 !== e) {\n    var i = e.call(t, r || \"default\");\n    if (\"object\" != _typeof(i)) return i;\n    throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n  }\n  return (\"string\" === r ? String : Number)(t);\n}\nexport { toPrimitive as default };","import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperty(e, r, t) {\n  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n    value: t,\n    enumerable: !0,\n    configurable: !0,\n    writable: !0\n  }) : e[r] = t, e;\n}\nexport { _defineProperty as default };","//#region src/core/utils/numbers.ts\nfunction e(e, t) {\n\treturn Number.isFinite(e) ? Number(e) : t;\n}\nfunction t(e, t, n) {\n\treturn Math.min(Math.max(e, t), n);\n}\nfunction n(...e) {\n\treturn [...e].reduce((e, t) => t + e, 0);\n}\nfunction r(e, t, n) {\n\treturn e * (n - t) + t;\n}\nfunction i(e, t, n) {\n\tlet r = (e - t) / (n - t);\n\treturn Number.isNaN(r) ? 0 : r;\n}\n//#endregion\nexport { t as clamp, e as defaultNumber, i as percentageOf, r as percentageWithin, n as sum };\n","/*\nCopyright 2024 New Vector Ltd.\nCopyright 2020, 2021 The Matrix.org Foundation C.I.C.\n\nSPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport { percentageOf, percentageWithin } from \"@element-hq/web-shared-components/numbers\";\n\n/**\n * Quickly resample an array to have less/more data points. If an input which is larger\n * than the desired size is provided, it will be downsampled. Similarly, if the input\n * is smaller than the desired size then it will be upsampled.\n * @param {number[]} input The input array to resample.\n * @param {number} points The number of samples to end up with.\n * @returns {number[]} The resampled array.\n */\nexport function arrayFastResample(input: number[], points: number): number[] {\n    if (input.length === points) return input; // short-circuit a complicated call\n\n    // Heavily inspired by matrix-media-repo (used with permission)\n    // https://github.com/turt2live/matrix-media-repo/blob/abe72c87d2e29/util/util_audio/fastsample.go#L10\n    const samples: number[] = [];\n    if (input.length > points) {\n        // Danger: this loop can cause out of memory conditions if the input is too small.\n        const everyNth = Math.round(input.length / points);\n        for (let i = 0; i < input.length; i += everyNth) {\n            samples.push(input[i]);\n        }\n    } else {\n        // Smaller inputs mean we have to spread the values over the desired length. We\n        // end up overshooting the target length in doing this, but we're not looking to\n        // be super accurate so we'll let the sanity trims do their job.\n        const spreadFactor = Math.ceil(points / input.length);\n        for (const val of input) {\n            samples.push(...arraySeed(val, spreadFactor));\n        }\n    }\n\n    // Trim to size & return\n    return arrayTrimFill(samples, points, arraySeed(input[input.length - 1], points));\n}\n\n/**\n * Attempts a smooth resample of the given array. This is functionally similar to arrayFastResample\n * though can take longer due to the smoothing of data.\n * @param {number[]} input The input array to resample.\n * @param {number} points The number of samples to end up with.\n * @returns {number[]} The resampled array.\n */\nexport function arraySmoothingResample(input: number[], points: number): number[] {\n    if (input.length === points) return input; // short-circuit a complicated call\n\n    let samples: number[] = [];\n    if (input.length > points) {\n        // We're downsampling. To preserve the curve we'll actually reduce our sample\n        // selection and average some points between them.\n\n        // All we're doing here is repeatedly averaging the waveform down to near our\n        // target value. We don't average down to exactly our target as the loop might\n        // never end, and we can over-average the data. Instead, we'll get as far as\n        // we can and do a followup fast resample (the neighbouring points will be close\n        // to the actual waveform, so we can get away with this safely).\n        while (samples.length > points * 2 || samples.length === 0) {\n            samples = [];\n            for (let i = 1; i < input.length - 1; i += 2) {\n                const prevPoint = input[i - 1];\n                const nextPoint = input[i + 1];\n                const currPoint = input[i];\n                const average = (prevPoint + nextPoint + currPoint) / 3;\n                samples.push(average);\n            }\n            input = samples;\n        }\n\n        return arrayFastResample(samples, points);\n    } else {\n        // In practice there's not much purpose in burning CPU for short arrays only to\n        // end up with a result that can't possibly look much different than the fast\n        // resample, so just skip ahead to the fast resample.\n        return arrayFastResample(input, points);\n    }\n}\n\n/**\n * Rescales the input array to have values that are inclusively within the provided\n * minimum and maximum.\n * @param {number[]} input The array to rescale.\n * @param {number} newMin The minimum value to scale to.\n * @param {number} newMax The maximum value to scale to.\n * @returns {number[]} The rescaled array.\n */\nexport function arrayRescale(input: number[], newMin: number, newMax: number): number[] {\n    const min: number = Math.min(...input);\n    const max: number = Math.max(...input);\n    return input.map((v) => percentageWithin(percentageOf(v, min, max), newMin, newMax));\n}\n\n/**\n * Creates an array of the given length, seeded with the given value.\n * @param {T} val The value to seed the array with.\n * @param {number} length The length of the array to create.\n * @returns {T[]} The array.\n */\nexport function arraySeed<T>(val: T, length: number): T[] {\n    // Size the array up front for performance, and use `fill` to let the browser\n    // optimize the operation better than we can with a `for` loop, if it wants.\n    return new Array<T>(length).fill(val);\n}\n\n/**\n * Trims or fills the array to ensure it meets the desired length. The seed array\n * given is pulled from to fill any missing slots - it is recommended that this be\n * at least `len` long. The resulting array will be exactly `len` long, either\n * trimmed from the source or filled with the some/all of the seed array.\n * @param {T[]} a The array to trim/fill.\n * @param {number} len The length to trim or fill to, as needed.\n * @param {T[]} seed Values to pull from if the array needs filling.\n * @returns {T[]} The resulting array of `len` length.\n */\nexport function arrayTrimFill<T>(a: T[], len: number, seed: T[]): T[] {\n    // Dev note: we do length checks because the spread operator can result in some\n    // performance penalties in more critical code paths. As a utility, it should be\n    // as fast as possible to not cause a problem for the call stack, no matter how\n    // critical that stack is.\n    if (a.length === len) return a;\n    if (a.length > len) return a.slice(0, len);\n    return a.concat(seed.slice(0, len - a.length));\n}\n\n/**\n * Clones an array as fast as possible, retaining references of the array's values.\n * @param a The array to clone. Must be defined.\n * @returns A copy of the array.\n */\nexport function arrayFastClone<T>(a: T[]): T[] {\n    return a.slice(0, a.length);\n}\n\n/**\n * Determines if the two arrays are different either in length, contents,\n * or order of those contents.\n * @param a The first array. Must be defined.\n * @param b The second array. Must be defined.\n * @returns True if they are different, false otherwise.\n */\nexport function arrayHasOrderChange(a: any[], b: any[]): boolean {\n    if (a.length === b.length) {\n        for (let i = 0; i < a.length; i++) {\n            if (a[i] !== b[i]) return true;\n        }\n        return false;\n    } else {\n        return true; // like arrayHasDiff, a difference in length is a natural change\n    }\n}\n\n/**\n * Determines if two arrays are different through a shallow comparison.\n * @param a The first array. Must be defined.\n * @param b The second array. Must be defined.\n * @returns True if they are different, false otherwise.\n */\nexport function arrayHasDiff(a: any[], b: any[]): boolean {\n    if (a.length === b.length) {\n        // When the lengths are equal, check to see if either array is missing\n        // an element from the other.\n        if (b.some((i) => !a.includes(i))) return true;\n        if (a.some((i) => !b.includes(i))) return true;\n\n        // if all the keys are common, say so\n        return false;\n    } else {\n        return true; // different lengths means they are naturally diverged\n    }\n}\n\nexport type Diff<T> = { added: T[]; removed: T[] };\n\n/**\n * Performs a diff on two arrays. The result is what is different with the\n * first array (`added` in the returned object means objects in B that aren't\n * in A). Shallow comparisons are used to perform the diff.\n * @param a The first array. Must be defined.\n * @param b The second array. Must be defined.\n * @returns The diff between the arrays.\n */\nexport function arrayDiff<T>(a: T[], b: T[]): Diff<T> {\n    return {\n        added: b.filter((i) => !a.includes(i)),\n        removed: a.filter((i) => !b.includes(i)),\n    };\n}\n\n/**\n * Returns the intersection of two arrays.\n * @param a The first array. Must be defined.\n * @param b The second array. Must be defined.\n * @returns The intersection of the arrays.\n */\nexport function arrayIntersection<T>(a: T[], b: T[]): T[] {\n    return a.filter((i) => b.includes(i));\n}\n\n/**\n * Unions arrays, deduping contents using a Set.\n * @param a The arrays to merge.\n * @returns The union of all given arrays.\n */\nexport function arrayUnion<T>(...a: T[][]): T[] {\n    return Array.from(\n        a.reduce((c, v) => {\n            v.forEach((i) => c.add(i));\n            return c;\n        }, new Set<T>()),\n    );\n}\n\n/**\n * Moves a single element from fromIndex to toIndex.\n * @param {array} list the list from which to construct the new list.\n * @param {number} fromIndex the index of the element to move.\n * @param {number} toIndex the index of where to put the element.\n * @returns {array} A new array with the requested value moved.\n */\nexport function moveElement<T>(list: T[], fromIndex: number, toIndex: number): T[] {\n    const result = Array.from(list);\n    const [removed] = result.splice(fromIndex, 1);\n    result.splice(toIndex, 0, removed);\n\n    return result;\n}\n\n/**\n * Helper functions to perform LINQ-like queries on arrays.\n */\nexport class ArrayUtil<T> {\n    /**\n     * Create a new array helper.\n     * @param a The array to help. Can be modified in-place.\n     */\n    public constructor(private a: T[]) {}\n\n    /**\n     * The value of this array, after all appropriate alterations.\n     */\n    public get value(): T[] {\n        return this.a;\n    }\n\n    /**\n     * Groups an array by keys.\n     * @param fn The key-finding function.\n     * @returns This.\n     */\n    public groupBy<K>(fn: (a: T) => K): GroupedArray<K, T> {\n        const obj = this.a.reduce((rv: Map<K, T[]>, val: T) => {\n            const k = fn(val);\n            if (!rv.has(k)) rv.set(k, []);\n            rv.get(k)!.push(val);\n            return rv;\n        }, new Map<K, T[]>());\n        return new GroupedArray(obj);\n    }\n}\n\n/**\n * Helper functions to perform LINQ-like queries on groups (maps).\n */\nexport class GroupedArray<K, T> {\n    /**\n     * Creates a new group helper.\n     * @param val The group to help. Can be modified in-place.\n     */\n    public constructor(private val: Map<K, T[]>) {}\n\n    /**\n     * The value of this group, after all applicable alterations.\n     */\n    public get value(): Map<K, T[]> {\n        return this.val;\n    }\n\n    /**\n     * Orders the grouping into an array using the provided key order.\n     * @param keyOrder The key order.\n     * @returns An array helper of the result.\n     */\n    public orderBy(keyOrder: K[]): ArrayUtil<T> {\n        const a: T[] = [];\n        for (const k of keyOrder) {\n            if (!this.val.has(k)) continue;\n            a.push(...this.val.get(k)!);\n        }\n        return new ArrayUtil(a);\n    }\n}\n\nexport const concat = (...arrays: Uint8Array<ArrayBuffer>[]): Uint8Array<ArrayBuffer> => {\n    return arrays.reduce((concatenatedSoFar: Uint8Array<ArrayBuffer>, toBeConcatenated: Uint8Array<ArrayBuffer>) => {\n        const concatenated = new Uint8Array(concatenatedSoFar.length + toBeConcatenated.length);\n        concatenated.set(concatenatedSoFar, 0);\n        concatenated.set(toBeConcatenated, concatenatedSoFar.length);\n        return concatenated;\n    }, new Uint8Array(0));\n};\n\n/**\n * Async version of Array.every.\n */\nexport async function asyncEvery<T>(values: Iterable<T>, predicate: (value: T) => Promise<boolean>): Promise<boolean> {\n    for (const value of values) {\n        if (!(await predicate(value))) return false;\n    }\n    return true;\n}\n\n/**\n * Async version of Array.some.\n */\nexport async function asyncSome<T>(values: Iterable<T>, predicate: (value: T) => Promise<boolean>): Promise<boolean> {\n    for (const value of values) {\n        if (await predicate(value)) return true;\n    }\n    return false;\n}\n\n/**\n * Async version of Array.some that runs all promises in parallel.\n * @param values\n * @param predicate\n */\nexport async function asyncSomeParallel<T>(\n    values: Array<T>,\n    predicate: (value: T) => Promise<boolean>,\n): Promise<boolean> {\n    try {\n        return await Promise.any<boolean>(\n            values.map((value) =>\n                predicate(value).then((result) => (result ? Promise.resolve(true) : Promise.reject(false))),\n            ),\n        );\n    } catch (e) {\n        // If the array is empty or all the promises are false, Promise.any will reject an AggregateError\n        if (e instanceof AggregateError) return false;\n        throw e;\n    }\n}\n\n/**\n * Async version of Array.filter.\n * If one of the promises rejects, the whole operation will reject.\n * @param values\n * @param predicate\n */\nexport async function asyncFilter<T>(values: Array<T>, predicate: (value: T) => Promise<boolean>): Promise<Array<T>> {\n    const results = await Promise.all(values.map(predicate));\n    return values.filter((_, i) => results[i]);\n}\n\nexport function filterBoolean<T>(values: Array<T | null | undefined>): T[] {\n    return values.filter(Boolean) as T[];\n}\n","/*\nCopyright 2024 New Vector Ltd.\nCopyright 2021 The Matrix.org Foundation C.I.C.\n\nSPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport { arraySeed } from \"../utils/arrays\";\n\nexport const WORKLET_NAME = \"mx-voice-worklet\";\n\nexport enum PayloadEvent {\n    Timekeep = \"timekeep\",\n    AmplitudeMark = \"amplitude_mark\",\n}\n\nexport interface IPayload {\n    ev: PayloadEvent;\n}\n\nexport interface ITimingPayload extends IPayload {\n    ev: PayloadEvent.Timekeep;\n    timeSeconds: number;\n}\n\nexport interface IAmplitudePayload extends IPayload {\n    ev: PayloadEvent.AmplitudeMark;\n    forIndex: number;\n    amplitude: number;\n}\n\nexport const PLAYBACK_WAVEFORM_SAMPLES = 39;\nexport const DEFAULT_WAVEFORM = arraySeed(0, PLAYBACK_WAVEFORM_SAMPLES);\n","/*\nCopyright 2024 New Vector Ltd.\nCopyright 2021 The Matrix.org Foundation C.I.C.\n\nSPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport { percentageOf } from \"@element-hq/web-shared-components/numbers\";\n\nimport { type IAmplitudePayload, type ITimingPayload, PayloadEvent, WORKLET_NAME } from \"./consts\";\n\n// from AudioWorkletGlobalScope: https://developer.mozilla.org/en-US/docs/Web/API/AudioWorkletGlobalScope\ndeclare const currentTime: number;\n// declare const currentFrame: number;\n// declare const sampleRate: number;\n\n// We rate limit here to avoid overloading downstream consumers with amplitude information.\n// The two major consumers are the voice message waveform thumbnail (resampled down to an\n// appropriate length) and the live waveform shown to the user. Effectively, this controls\n// the refresh rate of that live waveform and the number of samples the thumbnail has to\n// work with.\nconst TARGET_AMPLITUDE_FREQUENCY = 16; // Hz\n\nfunction roundTimeToTargetFreq(seconds: number): number {\n    // Epsilon helps avoid floating point rounding issues (1 + 1 = 1.999999, etc)\n    return Math.round((seconds + Number.EPSILON) * TARGET_AMPLITUDE_FREQUENCY) / TARGET_AMPLITUDE_FREQUENCY;\n}\n\nfunction nextTimeForTargetFreq(roundedSeconds: number): number {\n    // The extra round is just to make sure we cut off any floating point issues\n    return roundTimeToTargetFreq(roundedSeconds + 1 / TARGET_AMPLITUDE_FREQUENCY);\n}\n\nclass MxVoiceWorklet extends AudioWorkletProcessor {\n    private nextAmplitudeSecond = 0;\n    private amplitudeIndex = 0;\n\n    public process(\n        inputs: Float32Array[][],\n        outputs: Float32Array[][],\n        parameters: Record<string, Float32Array>,\n    ): boolean {\n        const currentSecond = roundTimeToTargetFreq(currentTime);\n        // We special case the first ping because there's a fairly good chance that we'll miss the zeroth\n        // update. Firefox for instance takes 0.06 seconds (roughly) to call this function for the first\n        // time. Edge and Chrome occasionally lag behind too, but for the most part are on time.\n        //\n        // When this doesn't work properly we end up producing a waveform of nulls and no live preview\n        // of the recorded message.\n        if (currentSecond === this.nextAmplitudeSecond || this.nextAmplitudeSecond === 0) {\n            // We're expecting exactly one mono input source, so just grab the very first frame of\n            // samples for the analysis.\n            const monoChan = inputs[0][0];\n\n            // The amplitude of the frame's samples is effectively the loudness of the frame. This\n            // translates into a bar which can be rendered as part of the whole recording clip's\n            // waveform.\n            //\n            // We translate the amplitude down to 0-1 for sanity's sake.\n            const minVal = Math.min(...monoChan);\n            const maxVal = Math.max(...monoChan);\n            const amplitude = percentageOf(maxVal, -1, 1) - percentageOf(minVal, -1, 1);\n\n            this.port.postMessage(<IAmplitudePayload>{\n                ev: PayloadEvent.AmplitudeMark,\n                amplitude: amplitude,\n                forIndex: this.amplitudeIndex++,\n            });\n            this.nextAmplitudeSecond = nextTimeForTargetFreq(currentSecond);\n        }\n\n        // We mostly use this worklet to fire regular clock updates through to components\n        this.port.postMessage(<ITimingPayload>{ ev: PayloadEvent.Timekeep, timeSeconds: currentTime });\n\n        // We're supposed to return false when we're \"done\" with the audio clip, but seeing as\n        // we are acting as a passive processor we are never truly \"done\". The browser will clean\n        // us up when it is done with us.\n        return true;\n    }\n}\n\nregisterProcessor(WORKLET_NAME, MxVoiceWorklet);\n\nexport default \"\"; // to appease module loaders (we never use the export)\n"],"names":["_typeof","o","Symbol","iterator","constructor","prototype","toPropertyKey","t","i","r","e","toPrimitive","call","TypeError","String","Number","_defineProperty","Object","defineProperty","value","enumerable","configurable","writable","n","isNaN","arraySeed","val","length","Array","fill","PayloadEvent","roundTimeToTargetFreq","seconds","Math","round","EPSILON","MxVoiceWorklet","AudioWorkletProcessor","args","super","this","process","inputs","outputs","parameters","currentSecond","currentTime","nextAmplitudeSecond","monoChan","minVal","min","amplitude","percentageOf","max","port","postMessage","ev","AmplitudeMark","forIndex","amplitudeIndex","Timekeep","timeSeconds","registerProcessor"],"sourceRoot":""}