deploy: cf574d0b68
parent
fa4e76de0c
commit
2a0b5b56a6
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
{"assets/backup.png":["assets/backup.png"],"assets/banner.png":["assets/banner.png"],"assets/banner_dark.png":["assets/banner_dark.png"],"assets/banner_transparent.png":["assets/banner_transparent.png"],"assets/chat.svg":["assets/chat.svg"],"assets/favicon.ico":["assets/favicon.ico"],"assets/favicon.png":["assets/favicon.png"],"assets/info-logo.png":["assets/info-logo.png"],"assets/info-logo.svg":["assets/info-logo.svg"],"assets/js/package/olm.js":["assets/js/package/olm.js"],"assets/js/package/olm.wasm":["assets/js/package/olm.wasm"],"assets/js/package/olm_legacy.js":["assets/js/package/olm_legacy.js"],"assets/login_wallpaper.png":["assets/login_wallpaper.png"],"assets/logo.png":["assets/logo.png"],"assets/logo.svg":["assets/logo.svg"],"assets/sas-emoji.json":["assets/sas-emoji.json"],"assets/share.png":["assets/share.png"],"assets/sounds/call.ogg":["assets/sounds/call.ogg"],"assets/sounds/notification.ogg":["assets/sounds/notification.ogg"],"assets/sounds/phone.ogg":["assets/sounds/phone.ogg"],"assets/typing.gif":["assets/typing.gif"],"assets/typing.svg":["assets/typing.svg"],"assets/verification.png":["assets/verification.png"],"fonts/NotoEmoji/NotoColorEmoji.ttf":["fonts/NotoEmoji/NotoColorEmoji.ttf"],"fonts/Roboto/Roboto-Bold.ttf":["fonts/Roboto/Roboto-Bold.ttf"],"fonts/Roboto/Roboto-Italic.ttf":["fonts/Roboto/Roboto-Italic.ttf"],"fonts/Roboto/Roboto-Regular.ttf":["fonts/Roboto/Roboto-Regular.ttf"],"fonts/Roboto/RobotoMono-Regular.ttf":["fonts/Roboto/RobotoMono-Regular.ttf"],"packages/cupertino_icons/assets/CupertinoIcons.ttf":["packages/cupertino_icons/assets/CupertinoIcons.ttf"],"packages/flutter_map/lib/assets/flutter_map_logo.png":["packages/flutter_map/lib/assets/flutter_map_logo.png"],"packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_AMS-Regular.ttf":["packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_AMS-Regular.ttf"],"packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Caligraphic-Bold.ttf":["packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Caligraphic-Bold.ttf"],"packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Caligraphic-Regular.ttf":["packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Caligraphic-Regular.ttf"],"packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Fraktur-Bold.ttf":["packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Fraktur-Bold.ttf"],"packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Fraktur-Regular.ttf":["packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Fraktur-Regular.ttf"],"packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Main-Bold.ttf":["packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Main-Bold.ttf"],"packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Main-BoldItalic.ttf":["packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Main-BoldItalic.ttf"],"packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Main-Italic.ttf":["packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Main-Italic.ttf"],"packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Main-Regular.ttf":["packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Main-Regular.ttf"],"packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Math-BoldItalic.ttf":["packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Math-BoldItalic.ttf"],"packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Math-Italic.ttf":["packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Math-Italic.ttf"],"packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_SansSerif-Bold.ttf":["packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_SansSerif-Bold.ttf"],"packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_SansSerif-Italic.ttf":["packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_SansSerif-Italic.ttf"],"packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_SansSerif-Regular.ttf":["packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_SansSerif-Regular.ttf"],"packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Script-Regular.ttf":["packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Script-Regular.ttf"],"packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Size1-Regular.ttf":["packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Size1-Regular.ttf"],"packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Size2-Regular.ttf":["packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Size2-Regular.ttf"],"packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Size3-Regular.ttf":["packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Size3-Regular.ttf"],"packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Size4-Regular.ttf":["packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Size4-Regular.ttf"],"packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Typewriter-Regular.ttf":["packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Typewriter-Regular.ttf"],"packages/record_web/assets/js/record.worklet.js":["packages/record_web/assets/js/record.worklet.js"],"packages/wakelock_plus/assets/no_sleep.js":["packages/wakelock_plus/assets/no_sleep.js"]}
|
||||
{"assets/backup.png":["assets/backup.png"],"assets/banner.png":["assets/banner.png"],"assets/banner_dark.png":["assets/banner_dark.png"],"assets/banner_transparent.png":["assets/banner_transparent.png"],"assets/chat.svg":["assets/chat.svg"],"assets/favicon.ico":["assets/favicon.ico"],"assets/favicon.png":["assets/favicon.png"],"assets/info-logo.png":["assets/info-logo.png"],"assets/info-logo.svg":["assets/info-logo.svg"],"assets/js/package/olm.js":["assets/js/package/olm.js"],"assets/js/package/olm.wasm":["assets/js/package/olm.wasm"],"assets/js/package/olm_legacy.js":["assets/js/package/olm_legacy.js"],"assets/login_wallpaper.png":["assets/login_wallpaper.png"],"assets/logo.png":["assets/logo.png"],"assets/logo.svg":["assets/logo.svg"],"assets/sas-emoji.json":["assets/sas-emoji.json"],"assets/share.png":["assets/share.png"],"assets/sounds/call.ogg":["assets/sounds/call.ogg"],"assets/sounds/notification.ogg":["assets/sounds/notification.ogg"],"assets/sounds/phone.ogg":["assets/sounds/phone.ogg"],"assets/typing.gif":["assets/typing.gif"],"assets/typing.svg":["assets/typing.svg"],"assets/verification.png":["assets/verification.png"],"fonts/NotoEmoji/NotoColorEmoji.ttf":["fonts/NotoEmoji/NotoColorEmoji.ttf"],"fonts/Roboto/Roboto-Bold.ttf":["fonts/Roboto/Roboto-Bold.ttf"],"fonts/Roboto/Roboto-Italic.ttf":["fonts/Roboto/Roboto-Italic.ttf"],"fonts/Roboto/Roboto-Regular.ttf":["fonts/Roboto/Roboto-Regular.ttf"],"fonts/Roboto/RobotoMono-Regular.ttf":["fonts/Roboto/RobotoMono-Regular.ttf"],"packages/cupertino_icons/assets/CupertinoIcons.ttf":["packages/cupertino_icons/assets/CupertinoIcons.ttf"],"packages/flutter_map/lib/assets/flutter_map_logo.png":["packages/flutter_map/lib/assets/flutter_map_logo.png"],"packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_AMS-Regular.ttf":["packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_AMS-Regular.ttf"],"packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Caligraphic-Bold.ttf":["packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Caligraphic-Bold.ttf"],"packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Caligraphic-Regular.ttf":["packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Caligraphic-Regular.ttf"],"packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Fraktur-Bold.ttf":["packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Fraktur-Bold.ttf"],"packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Fraktur-Regular.ttf":["packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Fraktur-Regular.ttf"],"packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Main-Bold.ttf":["packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Main-Bold.ttf"],"packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Main-BoldItalic.ttf":["packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Main-BoldItalic.ttf"],"packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Main-Italic.ttf":["packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Main-Italic.ttf"],"packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Main-Regular.ttf":["packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Main-Regular.ttf"],"packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Math-BoldItalic.ttf":["packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Math-BoldItalic.ttf"],"packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Math-Italic.ttf":["packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Math-Italic.ttf"],"packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_SansSerif-Bold.ttf":["packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_SansSerif-Bold.ttf"],"packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_SansSerif-Italic.ttf":["packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_SansSerif-Italic.ttf"],"packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_SansSerif-Regular.ttf":["packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_SansSerif-Regular.ttf"],"packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Script-Regular.ttf":["packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Script-Regular.ttf"],"packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Size1-Regular.ttf":["packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Size1-Regular.ttf"],"packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Size2-Regular.ttf":["packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Size2-Regular.ttf"],"packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Size3-Regular.ttf":["packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Size3-Regular.ttf"],"packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Size4-Regular.ttf":["packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Size4-Regular.ttf"],"packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Typewriter-Regular.ttf":["packages/flutter_math_fork/lib/katex_fonts/fonts/KaTeX_Typewriter-Regular.ttf"],"packages/wakelock_plus/assets/no_sleep.js":["packages/wakelock_plus/assets/no_sleep.js"]}
|
@ -1,131 +0,0 @@
|
||||
class RecorderProcessor extends AudioWorkletProcessor {
|
||||
// Buffer size compromise between size and process call frequency
|
||||
bufferSize = 4096
|
||||
// The current buffer fill level
|
||||
_bytesWritten = 0
|
||||
|
||||
// Create a buffer of fixed size
|
||||
_buffers = []
|
||||
|
||||
_numChannels = 1
|
||||
|
||||
constructor(options) {
|
||||
super()
|
||||
|
||||
this._numChannels = options.numberOfOutputs
|
||||
|
||||
this.initBuffer()
|
||||
}
|
||||
|
||||
initBuffer() {
|
||||
this._bytesWritten = 0
|
||||
this._buffers = []
|
||||
|
||||
for (let channel = 0; channel < this._numChannels; channel++) {
|
||||
this._buffers[channel] = []
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {boolean}
|
||||
*/
|
||||
isBufferEmpty() {
|
||||
return this._bytesWritten === 0
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {boolean}
|
||||
*/
|
||||
isBufferFull() {
|
||||
return this._bytesWritten >= this.bufferSize
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Float32Array[][]} inputs
|
||||
* @returns {boolean}
|
||||
*/
|
||||
process(inputs) {
|
||||
if (this.isBufferFull()) {
|
||||
this.flush()
|
||||
}
|
||||
|
||||
const input = inputs[0]
|
||||
|
||||
for (let channel = 0; channel < this._numChannels; channel++) {
|
||||
// Push a copy of the array.
|
||||
// The underlying implementation may reuse it which will break the recording.
|
||||
this._buffers[channel].push([...input[channel]])
|
||||
}
|
||||
|
||||
this._bytesWritten += input[0].length
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
flush() {
|
||||
let channels = []
|
||||
for (let channel = 0; channel < this._numChannels; channel++) {
|
||||
channels.push(this.mergeFloat32Arrays(this._buffers[channel], this._bytesWritten))
|
||||
}
|
||||
|
||||
let interleaved = this.interleave(channels)
|
||||
|
||||
this.port.postMessage(this.floatTo16BitPCM(interleaved))
|
||||
|
||||
this.initBuffer()
|
||||
}
|
||||
|
||||
mergeFloat32Arrays(arrays, bytesWritten) {
|
||||
let result = new Float32Array(bytesWritten)
|
||||
var offset = 0
|
||||
|
||||
for (let i = 0; i < arrays.length; i++) {
|
||||
result.set(arrays[i], offset)
|
||||
offset += arrays[i].length
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
// Interleave data from channels from LLLLLLLLRRRRRRRR to LRLRLRLRLRLRLRLR
|
||||
interleave(channels) {
|
||||
if (channels === 1) {
|
||||
return channels[0]
|
||||
}
|
||||
|
||||
var length = 0
|
||||
for (let i = 0; i < channels.length; i++) {
|
||||
length += channels[i].length
|
||||
}
|
||||
|
||||
let result = new Float32Array(length)
|
||||
|
||||
var index = 0
|
||||
var inputIndex = 0
|
||||
|
||||
while (index < length) {
|
||||
for (let i = 0; i < channels.length; i++) {
|
||||
result[index] = channels[i][inputIndex]
|
||||
index++
|
||||
}
|
||||
|
||||
inputIndex++
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
floatTo16BitPCM(input) {
|
||||
let output = new DataView(new ArrayBuffer(input.length * 2))
|
||||
|
||||
for (let i = 0; i < input.length; i++) {
|
||||
let s = Math.max(-1, Math.min(1, input[i]))
|
||||
let s16 = s < 0 ? s * 0x8000 : s * 0x7FFF
|
||||
output.setInt16(i * 2, s16, true)
|
||||
}
|
||||
|
||||
return new Int16Array(output.buffer)
|
||||
}
|
||||
}
|
||||
|
||||
registerProcessor("recorder.worklet", RecorderProcessor)
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue