flet 0.20.0.dev2221__tar.gz → 0.20.0.dev2223__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/PKG-INFO +2 -2
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/pyproject.toml +2 -2
- flet-0.20.0.dev2223/src/flet/web/assets/AssetManifest.bin +1 -0
- flet-0.20.0.dev2223/src/flet/web/assets/AssetManifest.bin.json +1 -0
- flet-0.20.0.dev2223/src/flet/web/assets/AssetManifest.json +1 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/web/assets/NOTICES +65 -0
- flet-0.20.0.dev2223/src/flet/web/assets/packages/record_web/assets/js/record.worklet.js +400 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/web/flutter_service_worker.js +8 -7
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/web/index.html +1 -1
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/web/main.dart.js +88796 -87142
- flet-0.20.0.dev2221/src/flet/web/assets/AssetManifest.bin +0 -1
- flet-0.20.0.dev2221/src/flet/web/assets/AssetManifest.bin.json +0 -1
- flet-0.20.0.dev2221/src/flet/web/assets/AssetManifest.json +0 -1
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/README.md +0 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/__init__.py +0 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/__pyinstaller/__init__.py +0 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/__pyinstaller/config.py +0 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/__pyinstaller/hook-flet.py +0 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/__pyinstaller/macos_utils.py +0 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/__pyinstaller/rthooks/pyi_rth_localhost_fletd.py +0 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/__pyinstaller/rthooks.dat +0 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/__pyinstaller/utils.py +0 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/__pyinstaller/win_utils.py +0 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/async_websocket_connection.py +0 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/auth/__init__.py +0 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/auth/providers/__init__.py +0 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/canvas/__init__.py +0 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/cli/cli.py +0 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/cli/commands/base.py +0 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/cli/commands/build.py +0 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/cli/commands/create.py +0 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/cli/commands/options.py +0 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/cli/commands/pack.py +0 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/cli/commands/publish.py +0 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/cli/commands/run.py +0 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/constants.py +0 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/matplotlib_chart.py +0 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/plotly_chart.py +0 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/reconnecting_websocket.py +0 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/security.py +0 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/sync_websocket_connection.py +0 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/utils/__init__.py +0 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/version.py +0 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/web/.last_build_id +0 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/web/assets/FontManifest.json +0 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/web/assets/fonts/MaterialIcons-Regular.otf +0 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/web/assets/packages/window_manager/images/ic_chrome_close.png +0 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/web/assets/packages/window_manager/images/ic_chrome_maximize.png +0 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/web/assets/packages/window_manager/images/ic_chrome_minimize.png +0 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/web/assets/packages/window_manager/images/ic_chrome_unmaximize.png +0 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/web/assets/shaders/ink_sparkle.frag +0 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/web/favicon.png +0 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/web/flutter.js +0 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/web/icons/apple-touch-icon-192.png +0 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/web/icons/icon-192.png +0 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/web/icons/icon-512.png +0 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/web/icons/icon-maskable-192.png +0 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/web/icons/icon-maskable-512.png +0 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/web/icons/loading-animation.png +0 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/web/manifest.json +0 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/web/python-worker.js +0 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/web/python.js +0 -0
- {flet-0.20.0.dev2221 → flet-0.20.0.dev2223}/src/flet/web/version.json +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: flet
|
|
3
|
-
Version: 0.20.0.
|
|
3
|
+
Version: 0.20.0.dev2223
|
|
4
4
|
Summary: Flet for Python - easily build interactive multi-platform apps in Python
|
|
5
5
|
License: Apache-2.0
|
|
6
6
|
Author: Appveyor Systems Inc.
|
|
@@ -15,7 +15,7 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.11
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.12
|
|
17
17
|
Requires-Dist: cookiecutter (>=2.4.0,<3.0.0)
|
|
18
|
-
Requires-Dist: flet-runtime (==0.20.0.
|
|
18
|
+
Requires-Dist: flet-runtime (==0.20.0.dev2223)
|
|
19
19
|
Requires-Dist: packaging (>=23.1,<24.0)
|
|
20
20
|
Requires-Dist: qrcode (>=7.4.2,<8.0.0)
|
|
21
21
|
Requires-Dist: typing-extensions (>=4.6.2,<5.0.0) ; python_version < "3.8"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "flet"
|
|
3
|
-
version = "0.20.0.
|
|
3
|
+
version = "0.20.0.dev2223"
|
|
4
4
|
description = "Flet for Python - easily build interactive multi-platform apps in Python"
|
|
5
5
|
authors = ["Appveyor Systems Inc. <hello@flet.dev>"]
|
|
6
6
|
license = "Apache-2.0"
|
|
@@ -16,7 +16,7 @@ repository = "https://github.com/flet-dev/flet"
|
|
|
16
16
|
documentation = "https://flet.dev/docs"
|
|
17
17
|
|
|
18
18
|
[tool.poetry.dependencies]
|
|
19
|
-
flet-runtime = "0.20.0.
|
|
19
|
+
flet-runtime = "0.20.0.dev2223"
|
|
20
20
|
python = "^3.7"
|
|
21
21
|
typing-extensions = { version = "^4.6.2", python = "<3.8" }
|
|
22
22
|
websocket-client = "^1.5.2"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"DQUHL3BhY2thZ2VzL3JlY29yZF93ZWIvYXNzZXRzL2pzL3JlY29yZC53b3JrbGV0LmpzDAENAQcFYXNzZXQHL3BhY2thZ2VzL3JlY29yZF93ZWIvYXNzZXRzL2pzL3JlY29yZC53b3JrbGV0LmpzBzJwYWNrYWdlcy93aW5kb3dfbWFuYWdlci9pbWFnZXMvaWNfY2hyb21lX2Nsb3NlLnBuZwwBDQEHBWFzc2V0BzJwYWNrYWdlcy93aW5kb3dfbWFuYWdlci9pbWFnZXMvaWNfY2hyb21lX2Nsb3NlLnBuZwc1cGFja2FnZXMvd2luZG93X21hbmFnZXIvaW1hZ2VzL2ljX2Nocm9tZV9tYXhpbWl6ZS5wbmcMAQ0BBwVhc3NldAc1cGFja2FnZXMvd2luZG93X21hbmFnZXIvaW1hZ2VzL2ljX2Nocm9tZV9tYXhpbWl6ZS5wbmcHNXBhY2thZ2VzL3dpbmRvd19tYW5hZ2VyL2ltYWdlcy9pY19jaHJvbWVfbWluaW1pemUucG5nDAENAQcFYXNzZXQHNXBhY2thZ2VzL3dpbmRvd19tYW5hZ2VyL2ltYWdlcy9pY19jaHJvbWVfbWluaW1pemUucG5nBzdwYWNrYWdlcy93aW5kb3dfbWFuYWdlci9pbWFnZXMvaWNfY2hyb21lX3VubWF4aW1pemUucG5nDAENAQcFYXNzZXQHN3BhY2thZ2VzL3dpbmRvd19tYW5hZ2VyL2ltYWdlcy9pY19jaHJvbWVfdW5tYXhpbWl6ZS5wbmc="
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"packages/record_web/assets/js/record.worklet.js":["packages/record_web/assets/js/record.worklet.js"],"packages/window_manager/images/ic_chrome_close.png":["packages/window_manager/images/ic_chrome_close.png"],"packages/window_manager/images/ic_chrome_maximize.png":["packages/window_manager/images/ic_chrome_maximize.png"],"packages/window_manager/images/ic_chrome_minimize.png":["packages/window_manager/images/ic_chrome_minimize.png"],"packages/window_manager/images/ic_chrome_unmaximize.png":["packages/window_manager/images/ic_chrome_unmaximize.png"]}
|
|
@@ -31480,6 +31480,71 @@ The above software in this distribution may have been modified by
|
|
|
31480
31480
|
THL A29 Limited ("Tencent Modifications").
|
|
31481
31481
|
All Tencent Modifications are Copyright (C) 2015 THL A29 Limited.
|
|
31482
31482
|
--------------------------------------------------------------------------------
|
|
31483
|
+
record
|
|
31484
|
+
record_android
|
|
31485
|
+
record_linux
|
|
31486
|
+
record_platform_interface
|
|
31487
|
+
record_web
|
|
31488
|
+
record_windows
|
|
31489
|
+
|
|
31490
|
+
// Copyright 2022 openapi4j authors. All rights reserved.
|
|
31491
|
+
//
|
|
31492
|
+
// Redistribution and use in source and binary forms, with or without
|
|
31493
|
+
// modification, are permitted provided that the following conditions are
|
|
31494
|
+
// met:
|
|
31495
|
+
//
|
|
31496
|
+
// * Redistributions of source code must retain the above copyright
|
|
31497
|
+
// notice, this list of conditions and the following disclaimer.
|
|
31498
|
+
// * Redistributions in binary form must reproduce the above
|
|
31499
|
+
// copyright notice, this list of conditions and the following disclaimer
|
|
31500
|
+
// in the documentation and/or other materials provided with the
|
|
31501
|
+
// distribution.
|
|
31502
|
+
// * Neither the name of openapi4j nor the names of its
|
|
31503
|
+
// contributors may be used to endorse or promote products derived from
|
|
31504
|
+
// this software without specific prior written permission.
|
|
31505
|
+
//
|
|
31506
|
+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
31507
|
+
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
31508
|
+
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
31509
|
+
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
31510
|
+
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
31511
|
+
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
31512
|
+
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
31513
|
+
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
31514
|
+
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
31515
|
+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
31516
|
+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
31517
|
+
--------------------------------------------------------------------------------
|
|
31518
|
+
record_darwin
|
|
31519
|
+
|
|
31520
|
+
// Copyright 2022 openapi4j authors. All rights reserved.
|
|
31521
|
+
//
|
|
31522
|
+
// Redistribution and use in source and binary forms, with or without
|
|
31523
|
+
// modification, are permitted provided that the following conditions are
|
|
31524
|
+
// met:
|
|
31525
|
+
//
|
|
31526
|
+
// * Redistributions of source code must retain the above copyright
|
|
31527
|
+
// notice, this list of conditions and the following disclaimer.
|
|
31528
|
+
// * Redistributions in binary form must reproduce the above
|
|
31529
|
+
// copyright notice, this list of conditions and the following disclaimer
|
|
31530
|
+
// in the documentation and/or other materials provided with the
|
|
31531
|
+
// distribution.
|
|
31532
|
+
// * Neither the name of openapi4j nor the names of its
|
|
31533
|
+
// contributors may be used to endorse or promote products derived from
|
|
31534
|
+
// this software without specific prior written permission.
|
|
31535
|
+
//
|
|
31536
|
+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
31537
|
+
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
31538
|
+
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
31539
|
+
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
31540
|
+
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
31541
|
+
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
31542
|
+
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
31543
|
+
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
31544
|
+
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
31545
|
+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
31546
|
+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
31547
|
+
--------------------------------------------------------------------------------
|
|
31483
31548
|
redux
|
|
31484
31549
|
|
|
31485
31550
|
MIT License
|
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
class RecorderProcessor extends AudioWorkletProcessor {
|
|
2
|
+
static get parameterDescriptors() {
|
|
3
|
+
return [
|
|
4
|
+
{
|
|
5
|
+
name: 'numChannels',
|
|
6
|
+
defaultValue: 1,
|
|
7
|
+
minValue: 1,
|
|
8
|
+
maxValue: 16
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
name: 'sampleRate',
|
|
12
|
+
defaultValue: 48000,
|
|
13
|
+
minValue: 8000,
|
|
14
|
+
maxValue: 96000
|
|
15
|
+
}
|
|
16
|
+
];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Buffer size compromise between size and process call frequency
|
|
20
|
+
_bufferSize = 4096
|
|
21
|
+
// The current buffer fill level
|
|
22
|
+
_bytesWritten = 0
|
|
23
|
+
// Buffer per channel
|
|
24
|
+
_buffers = []
|
|
25
|
+
// Resampler (passthrough, down or up)
|
|
26
|
+
_resampler = null
|
|
27
|
+
// Config
|
|
28
|
+
_numChannels = 1
|
|
29
|
+
_sampleRate = 48000
|
|
30
|
+
|
|
31
|
+
constructor(options) {
|
|
32
|
+
super(options)
|
|
33
|
+
|
|
34
|
+
this._numChannels = options.parameterData.numChannels
|
|
35
|
+
this._sampleRate = options.parameterData.sampleRate
|
|
36
|
+
|
|
37
|
+
// Resampler(current context sample rate, desired sample rate, num channels, buffer size)
|
|
38
|
+
// num channels is always 1 since we resample after interleaving channels
|
|
39
|
+
this._resampler = new Resampler(sampleRate, this._sampleRate, 1, this._bufferSize * this._numChannels)
|
|
40
|
+
|
|
41
|
+
this.initBuffers()
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
initBuffers() {
|
|
45
|
+
this._bytesWritten = 0
|
|
46
|
+
this._buffers = []
|
|
47
|
+
|
|
48
|
+
for (let channel = 0; channel < this._numChannels; channel++) {
|
|
49
|
+
this._buffers[channel] = []
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* @returns {boolean}
|
|
55
|
+
*/
|
|
56
|
+
isBufferEmpty() {
|
|
57
|
+
return this._bytesWritten === 0
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* @returns {boolean}
|
|
62
|
+
*/
|
|
63
|
+
isBufferFull() {
|
|
64
|
+
return this._bytesWritten >= this._bufferSize
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* @param {Float32Array[][]} inputs
|
|
69
|
+
* @returns {boolean}
|
|
70
|
+
*/
|
|
71
|
+
process(inputs) {
|
|
72
|
+
if (this.isBufferFull()) {
|
|
73
|
+
this.flush()
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const input = inputs[0]
|
|
77
|
+
|
|
78
|
+
if (input.length == 0) {
|
|
79
|
+
// Sometimes, Firefox doesn't give any input. Skip this frame to not fail.
|
|
80
|
+
return true
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
for (let channel = 0; channel < this._numChannels; channel++) {
|
|
84
|
+
// Push a copy of the array.
|
|
85
|
+
// The underlying implementation may reuse it which will break the recording.
|
|
86
|
+
this._buffers[channel].push([...input[channel]])
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
this._bytesWritten += input[0].length
|
|
90
|
+
|
|
91
|
+
return true
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
flush() {
|
|
95
|
+
let channels = []
|
|
96
|
+
for (let channel = 0; channel < this._numChannels; channel++) {
|
|
97
|
+
channels.push(this.mergeFloat32Arrays(this._buffers[channel], this._bytesWritten))
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
let interleaved = this.interleave(channels)
|
|
101
|
+
|
|
102
|
+
let resampled = this._resampler.resample(interleaved)
|
|
103
|
+
|
|
104
|
+
this.port.postMessage(this.floatTo16BitPCM(resampled))
|
|
105
|
+
|
|
106
|
+
this.initBuffers()
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
mergeFloat32Arrays(arrays, bytesWritten) {
|
|
110
|
+
let result = new Float32Array(bytesWritten)
|
|
111
|
+
var offset = 0
|
|
112
|
+
|
|
113
|
+
for (let i = 0; i < arrays.length; i++) {
|
|
114
|
+
result.set(arrays[i], offset)
|
|
115
|
+
offset += arrays[i].length
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return result
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// Interleave data from channels from LLLLRRRR to LRLRLRLR
|
|
122
|
+
interleave(channels) {
|
|
123
|
+
if (channels === 1) {
|
|
124
|
+
return channels[0]
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
var length = 0
|
|
128
|
+
for (let i = 0; i < channels.length; i++) {
|
|
129
|
+
length += channels[i].length
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
let result = new Float32Array(length)
|
|
133
|
+
|
|
134
|
+
var index = 0
|
|
135
|
+
var inputIndex = 0
|
|
136
|
+
|
|
137
|
+
while (index < length) {
|
|
138
|
+
for (let i = 0; i < channels.length; i++) {
|
|
139
|
+
result[index] = channels[i][inputIndex]
|
|
140
|
+
index++
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
inputIndex++
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
return result
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
floatTo16BitPCM(input) {
|
|
150
|
+
let output = new DataView(new ArrayBuffer(input.length * 2))
|
|
151
|
+
|
|
152
|
+
for (let i = 0; i < input.length; i++) {
|
|
153
|
+
let s = Math.max(-1, Math.min(1, input[i]))
|
|
154
|
+
let s16 = s < 0 ? s * 0x8000 : s * 0x7FFF
|
|
155
|
+
output.setInt16(i * 2, s16, true)
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
return new Int16Array(output.buffer)
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
class Resampler {
|
|
163
|
+
constructor(fromSampleRate, toSampleRate, channels, inputBufferSize) {
|
|
164
|
+
|
|
165
|
+
if (!fromSampleRate || !toSampleRate || !channels) {
|
|
166
|
+
throw (new Error("Invalid settings specified for the resampler."));
|
|
167
|
+
}
|
|
168
|
+
this.resampler = null;
|
|
169
|
+
this.fromSampleRate = fromSampleRate;
|
|
170
|
+
this.toSampleRate = toSampleRate;
|
|
171
|
+
this.channels = channels || 0;
|
|
172
|
+
this.inputBufferSize = inputBufferSize;
|
|
173
|
+
this.initialize()
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
initialize() {
|
|
177
|
+
if (this.fromSampleRate == this.toSampleRate) {
|
|
178
|
+
|
|
179
|
+
// Setup resampler bypass - Resampler just returns what was passed through
|
|
180
|
+
this.resampler = (buffer) => {
|
|
181
|
+
return buffer
|
|
182
|
+
};
|
|
183
|
+
this.ratioWeight = 1;
|
|
184
|
+
|
|
185
|
+
} else {
|
|
186
|
+
if (this.fromSampleRate < this.toSampleRate) {
|
|
187
|
+
|
|
188
|
+
// Use generic linear interpolation if upsampling,
|
|
189
|
+
// as linear interpolation produces a gradient that we want
|
|
190
|
+
// and works fine with two input sample points per output in this case.
|
|
191
|
+
this.linearInterpolation();
|
|
192
|
+
this.lastWeight = 1;
|
|
193
|
+
|
|
194
|
+
} else {
|
|
195
|
+
|
|
196
|
+
// Custom resampler I wrote that doesn't skip samples
|
|
197
|
+
// like standard linear interpolation in high downsampling.
|
|
198
|
+
// This is more accurate than linear interpolation on downsampling.
|
|
199
|
+
this.multiTap();
|
|
200
|
+
this.tailExists = false;
|
|
201
|
+
this.lastWeight = 0;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// Initialize the internal buffer:
|
|
205
|
+
this.initializeBuffers();
|
|
206
|
+
this.ratioWeight = this.fromSampleRate / this.toSampleRate;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
bufferSlice(sliceAmount) {
|
|
211
|
+
|
|
212
|
+
//Typed array and normal array buffer section referencing:
|
|
213
|
+
try {
|
|
214
|
+
return this.outputBuffer.subarray(0, sliceAmount);
|
|
215
|
+
}
|
|
216
|
+
catch (error) {
|
|
217
|
+
try {
|
|
218
|
+
//Regular array pass:
|
|
219
|
+
this.outputBuffer.length = sliceAmount;
|
|
220
|
+
return this.outputBuffer;
|
|
221
|
+
}
|
|
222
|
+
catch (error) {
|
|
223
|
+
//Nightly Firefox 4 used to have the subarray function named as slice:
|
|
224
|
+
return this.outputBuffer.slice(0, sliceAmount);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
initializeBuffers() {
|
|
230
|
+
this.outputBufferSize = (Math.ceil(this.inputBufferSize * this.toSampleRate / this.fromSampleRate / this.channels * 1.000000476837158203125) + this.channels) + this.channels;
|
|
231
|
+
try {
|
|
232
|
+
this.outputBuffer = new Float32Array(this.outputBufferSize);
|
|
233
|
+
this.lastOutput = new Float32Array(this.channels);
|
|
234
|
+
}
|
|
235
|
+
catch (error) {
|
|
236
|
+
this.outputBuffer = [];
|
|
237
|
+
this.lastOutput = [];
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
linearInterpolation() {
|
|
242
|
+
this.resampler = (buffer) => {
|
|
243
|
+
let bufferLength = buffer.length,
|
|
244
|
+
channels = this.channels,
|
|
245
|
+
outLength,
|
|
246
|
+
ratioWeight,
|
|
247
|
+
weight,
|
|
248
|
+
firstWeight,
|
|
249
|
+
secondWeight,
|
|
250
|
+
sourceOffset,
|
|
251
|
+
outputOffset,
|
|
252
|
+
outputBuffer,
|
|
253
|
+
channel;
|
|
254
|
+
|
|
255
|
+
if ((bufferLength % channels) !== 0) {
|
|
256
|
+
throw (new Error("Buffer was of incorrect sample length."));
|
|
257
|
+
}
|
|
258
|
+
if (bufferLength <= 0) {
|
|
259
|
+
return [];
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
outLength = this.outputBufferSize;
|
|
263
|
+
ratioWeight = this.ratioWeight;
|
|
264
|
+
weight = this.lastWeight;
|
|
265
|
+
firstWeight = 0;
|
|
266
|
+
secondWeight = 0;
|
|
267
|
+
sourceOffset = 0;
|
|
268
|
+
outputOffset = 0;
|
|
269
|
+
outputBuffer = this.outputBuffer;
|
|
270
|
+
|
|
271
|
+
for (; weight < 1; weight += ratioWeight) {
|
|
272
|
+
secondWeight = weight % 1;
|
|
273
|
+
firstWeight = 1 - secondWeight;
|
|
274
|
+
this.lastWeight = weight % 1;
|
|
275
|
+
for (channel = 0; channel < this.channels; ++channel) {
|
|
276
|
+
outputBuffer[outputOffset++] = (this.lastOutput[channel] * firstWeight) + (buffer[channel] * secondWeight);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
weight -= 1;
|
|
280
|
+
for (bufferLength -= channels, sourceOffset = Math.floor(weight) * channels; outputOffset < outLength && sourceOffset < bufferLength;) {
|
|
281
|
+
secondWeight = weight % 1;
|
|
282
|
+
firstWeight = 1 - secondWeight;
|
|
283
|
+
for (channel = 0; channel < this.channels; ++channel) {
|
|
284
|
+
outputBuffer[outputOffset++] = (buffer[sourceOffset + ((channel > 0) ? (channel) : 0)] * firstWeight) + (buffer[sourceOffset + (channels + channel)] * secondWeight);
|
|
285
|
+
}
|
|
286
|
+
weight += ratioWeight;
|
|
287
|
+
sourceOffset = Math.floor(weight) * channels;
|
|
288
|
+
}
|
|
289
|
+
for (channel = 0; channel < channels; ++channel) {
|
|
290
|
+
this.lastOutput[channel] = buffer[sourceOffset++];
|
|
291
|
+
}
|
|
292
|
+
return this.bufferSlice(outputOffset);
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
multiTap() {
|
|
297
|
+
this.resampler = (buffer) => {
|
|
298
|
+
let bufferLength = buffer.length,
|
|
299
|
+
outLength,
|
|
300
|
+
output_variable_list,
|
|
301
|
+
channels = this.channels,
|
|
302
|
+
ratioWeight,
|
|
303
|
+
weight,
|
|
304
|
+
channel,
|
|
305
|
+
actualPosition,
|
|
306
|
+
amountToNext,
|
|
307
|
+
alreadyProcessedTail,
|
|
308
|
+
outputBuffer,
|
|
309
|
+
outputOffset,
|
|
310
|
+
currentPosition;
|
|
311
|
+
|
|
312
|
+
if ((bufferLength % channels) !== 0) {
|
|
313
|
+
throw (new Error("Buffer was of incorrect sample length."));
|
|
314
|
+
}
|
|
315
|
+
if (bufferLength <= 0) {
|
|
316
|
+
return [];
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
outLength = this.outputBufferSize;
|
|
320
|
+
output_variable_list = [];
|
|
321
|
+
ratioWeight = this.ratioWeight;
|
|
322
|
+
weight = 0;
|
|
323
|
+
actualPosition = 0;
|
|
324
|
+
amountToNext = 0;
|
|
325
|
+
alreadyProcessedTail = !this.tailExists;
|
|
326
|
+
this.tailExists = false;
|
|
327
|
+
outputBuffer = this.outputBuffer;
|
|
328
|
+
outputOffset = 0;
|
|
329
|
+
currentPosition = 0;
|
|
330
|
+
|
|
331
|
+
for (channel = 0; channel < channels; ++channel) {
|
|
332
|
+
output_variable_list[channel] = 0;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
do {
|
|
336
|
+
if (alreadyProcessedTail) {
|
|
337
|
+
weight = ratioWeight;
|
|
338
|
+
for (channel = 0; channel < channels; ++channel) {
|
|
339
|
+
output_variable_list[channel] = 0;
|
|
340
|
+
}
|
|
341
|
+
} else {
|
|
342
|
+
weight = this.lastWeight;
|
|
343
|
+
for (channel = 0; channel < channels; ++channel) {
|
|
344
|
+
output_variable_list[channel] = this.lastOutput[channel];
|
|
345
|
+
}
|
|
346
|
+
alreadyProcessedTail = true;
|
|
347
|
+
}
|
|
348
|
+
while (weight > 0 && actualPosition < bufferLength) {
|
|
349
|
+
amountToNext = 1 + actualPosition - currentPosition;
|
|
350
|
+
if (weight >= amountToNext) {
|
|
351
|
+
for (channel = 0; channel < channels; ++channel) {
|
|
352
|
+
output_variable_list[channel] += buffer[actualPosition++] * amountToNext;
|
|
353
|
+
}
|
|
354
|
+
currentPosition = actualPosition;
|
|
355
|
+
weight -= amountToNext;
|
|
356
|
+
} else {
|
|
357
|
+
for (channel = 0; channel < channels; ++channel) {
|
|
358
|
+
output_variable_list[channel] += buffer[actualPosition + ((channel > 0) ? channel : 0)] * weight;
|
|
359
|
+
}
|
|
360
|
+
currentPosition += weight;
|
|
361
|
+
weight = 0;
|
|
362
|
+
break;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
if (weight === 0) {
|
|
367
|
+
for (channel = 0; channel < channels; ++channel) {
|
|
368
|
+
outputBuffer[outputOffset++] = output_variable_list[channel] / ratioWeight;
|
|
369
|
+
}
|
|
370
|
+
} else {
|
|
371
|
+
this.lastWeight = weight;
|
|
372
|
+
for (channel = 0; channel < channels; ++channel) {
|
|
373
|
+
this.lastOutput[channel] = output_variable_list[channel];
|
|
374
|
+
}
|
|
375
|
+
this.tailExists = true;
|
|
376
|
+
break;
|
|
377
|
+
}
|
|
378
|
+
} while (actualPosition < bufferLength && outputOffset < outLength);
|
|
379
|
+
return this.bufferSlice(outputOffset);
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
resample(buffer) {
|
|
384
|
+
if (this.fromSampleRate == this.toSampleRate) {
|
|
385
|
+
this.ratioWeight = 1;
|
|
386
|
+
} else {
|
|
387
|
+
if (this.fromSampleRate < this.toSampleRate) {
|
|
388
|
+
this.lastWeight = 1;
|
|
389
|
+
} else {
|
|
390
|
+
this.tailExists = false;
|
|
391
|
+
this.lastWeight = 0;
|
|
392
|
+
}
|
|
393
|
+
this.initializeBuffers();
|
|
394
|
+
this.ratioWeight = this.fromSampleRate / this.toSampleRate;
|
|
395
|
+
}
|
|
396
|
+
return this.resampler(buffer)
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
registerProcessor("recorder.worklet", RecorderProcessor)
|
|
@@ -3,21 +3,22 @@ const MANIFEST = 'flutter-app-manifest';
|
|
|
3
3
|
const TEMP = 'flutter-temp-cache';
|
|
4
4
|
const CACHE_NAME = 'flutter-app-cache';
|
|
5
5
|
|
|
6
|
-
const RESOURCES = {"assets/AssetManifest.json": "
|
|
7
|
-
"assets/NOTICES": "
|
|
6
|
+
const RESOURCES = {"assets/AssetManifest.json": "a9cd9a02f902ec80dc431a19a3ecf7c7",
|
|
7
|
+
"assets/NOTICES": "d32e1acde748fe5047bed44e20372b0e",
|
|
8
|
+
"assets/packages/record_web/assets/js/record.worklet.js": "356bcfeddb8a625e3e2ba43ddf1cc13e",
|
|
8
9
|
"assets/packages/window_manager/images/ic_chrome_minimize.png": "4282cd84cb36edf2efb950ad9269ca62",
|
|
9
10
|
"assets/packages/window_manager/images/ic_chrome_maximize.png": "af7499d7657c8b69d23b85156b60298c",
|
|
10
11
|
"assets/packages/window_manager/images/ic_chrome_close.png": "75f4b8ab3608a05461a31fc18d6b47c2",
|
|
11
12
|
"assets/packages/window_manager/images/ic_chrome_unmaximize.png": "4a90c1909cb74e8f0d35794e2f61d8bf",
|
|
12
|
-
"assets/AssetManifest.bin.json": "
|
|
13
|
+
"assets/AssetManifest.bin.json": "94c54a7a95885df70978fc3579a0c4ad",
|
|
13
14
|
"assets/FontManifest.json": "7b2a36307916a9721811788013e65289",
|
|
14
15
|
"assets/shaders/ink_sparkle.frag": "4096b5150bac93c41cbc9b45276bd90f",
|
|
15
|
-
"assets/AssetManifest.bin": "
|
|
16
|
+
"assets/AssetManifest.bin": "83fcd91f53a462a1c0b791dd3233c10b",
|
|
16
17
|
"assets/fonts/MaterialIcons-Regular.otf": "f34ace52ea74c95e26949fab4870ac22",
|
|
17
18
|
"favicon.png": "302ac04c14db027d016d1fe74c6a80a0",
|
|
18
19
|
"manifest.json": "7909dae66a9203092dc86b5a6162e79c",
|
|
19
20
|
"flutter.js": "7d69e653079438abfbb24b82a655b0a4",
|
|
20
|
-
"main.dart.js": "
|
|
21
|
+
"main.dart.js": "e31f0fa7fa2c315a73f468faf4d22904",
|
|
21
22
|
"version.json": "3fea9d9c7b4ca6955aa03e762e0d2e13",
|
|
22
23
|
"icons/apple-touch-icon-192.png": "8cf0d5162941f467a77f023c414a1812",
|
|
23
24
|
"icons/icon-maskable-512.png": "aa798e6d780ff109da17c3a98d5f2619",
|
|
@@ -34,8 +35,8 @@ const RESOURCES = {"assets/AssetManifest.json": "d9150da08bcab79647bb00a0700488d
|
|
|
34
35
|
"canvaskit/chromium/canvaskit.wasm": "143af6ff368f9cd21c863bfa4274c406",
|
|
35
36
|
"canvaskit/chromium/canvaskit.js": "0ae8bbcc58155679458a0f7a00f66873",
|
|
36
37
|
"python-worker.js": "62a4865b3d41771b39660076485879be",
|
|
37
|
-
"index.html": "
|
|
38
|
-
"/": "
|
|
38
|
+
"index.html": "5c75151328b0ddfa1eeed941d388db88",
|
|
39
|
+
"/": "5c75151328b0ddfa1eeed941d388db88"};
|
|
39
40
|
// The application shell files that are downloaded before a service worker can
|
|
40
41
|
// start.
|
|
41
42
|
const CORE = ["main.dart.js",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
|
|
38
38
|
<script>
|
|
39
39
|
// The value below is injected by flutter build, do not touch.
|
|
40
|
-
const serviceWorkerVersion = "
|
|
40
|
+
const serviceWorkerVersion = "523220295";
|
|
41
41
|
</script>
|
|
42
42
|
<!-- This script adds the flutter initialization JS code -->
|
|
43
43
|
<script src="flutter.js" defer></script>
|