(index)
0 'nm_qjs' 0.1335
1 'nm_bun' 0.2385
2 'nm_deno' 0.2599000000059605
3 'nm_nodejs' 0.3421999999880791
4 'nm_spidermonkey' 0.39459999999403955
5 'nm_d8' 0.4187999999821186
6 'nm_tjs' 0.4192000000178814
An option for using piper
and onnx
voices in the browser is through Speech Dispatcher, which Chromium-based browsers (Chrome, Brave, Opera, Edge) and Firefox use for Web Speech API.
I have added the piper
module to Speech Dispatcher following the instructions here module request: piper #866.
Tested on Chromium Version 128.0.6586.0 (Developer Build) (64-bit) and Firefox Nightly 130.0a1. Chromium works. Firefox does not load the piper
voices.
In pertinent part.
Download the piper
executable from releases, extract the contents and save to ~/.local/opt/piper
.
// deno-fmt-ignore-file | |
// deno-lint-ignore-file | |
// This code was bundled using `deno bundle` and it's not recommended to edit it manually | |
var createPiperPhonemize = (()=>{ | |
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined; | |
if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename; | |
return function(moduleArg = {}) { | |
var Module = moduleArg; | |
var readyPromiseResolve, readyPromiseReject; |
In some environments and contexts the processing model is based on UTF-8. In those same environments the processing
model can be strings and not ArrayBuffer
or TypedArray
.
When the data includes Uint32Array
it could become necessary to convert Uint32Array
to Uint8Array
, Uint32Array
to Uint8Array
.
Here are some approaches I have used to convert between Uint32Array
(4 bytes per element) and Uint8Array
(1 byte per element).
Occasionally we might be experimenting inside a JavaScript or other engine, runtime, interpreter, or context where reading the standard input stream to the current process is either unintentionally or deliberately restricted.
The V8 JavaScript/WebAssembly engine has a developer shell called d8
. d8
has a readline()
function that in general
expects input from a TTY. Further, the expectation is generally that the input will be evaluated as a script.
See Using d8
. v8
is about 37.6 MB.
What this means is that if d8
is launched by a different process reading stardard input to d8
is not straightforward
where the input is not necessarily UTF-8.
Blob
and File
(which inherits from Blob
) have an arrayBuffer()
method, e.g.,
const file = new File(
[
new Float32Array(Array.from({
length: 1000,
async function parseChromeDefaultFileSystem(path) { | |
try { | |
const set = new Set([ | |
32, 45, 46, 47, 48, 49, 50, 51, 52, 53, | |
54, 55, 56, 57, 58, 64, 65, 66, 67, 68, | |
69, 70, 71, 72, 73, 74, 75, 76, 77, 78, | |
79, 80, 81, 82, 83, 84, 85, 86, 87, 88, | |
89, 90, 95, 97, 98, 99, 100, 101, 102, | |
103, 104, 105, 106, 107, 108, 109, 110, | |
111, 112, 113, 114, 115, 116, 117, 118, |
rM0Ux/LAST_FILE_ID0LAST_INTEGER-1FCHILD_OF:0:persistent-serviceworker1140persistent-serviceworkerUx/LAST_FILE_ID100Ux/TLAST_INTEGER0ZlCHILD_OF:1:README.md224000/00000000README.mdLAST_FILE_ID2KMD140persistent-serviceworkerUx/LAST_INTEGER1fVwCHILD_OF:1:README.md.crswap338400/00000001README.md.crswapLAST_FILE_ID3D140persistent-serviceworkerUx/dCHILD_OF:1:README.md.crswap324000/00000001README.mdInD140persistent-serviceworkerUx/D140persistent-serviceworkerUx/UeKCHILD_OF:1:chromium_extension_web_accessible_resources_iframe_message_event44X@chromium_extension_web_accessible_resources_iframe_message_eventUx/LAST_FILE_ID4TD140persistent-serviceworkerUx/HLAST_INTEGER2.tCHILD_OF:4:background.js558400/00000002background.jsLAST_FILE_ID5:l4X@chromium_extension_web_accessible_resources_iframe_message_eventUx/QL LAST_INTEGER3NwCHILD_OF:4:background.js.crswap66800/00000003background.js.crswapLAST_FILE_ID6l4X@chromium_extension_web_accessible_resources_iframe_message_eventUx/blCHILD_OF:4:background.js.crswap658400/00000003back |
// *Mostly* specfication conformant | |
// <input type="file" webkitdirectory> does not upload empty directories | |
// drop event with DataTransfer.item.getAsFileSystemDirectory() *does* | |
// list empty folders. | |
// W3C File API does not have a way to represent an empty directory. | |
// We use a File with type set to "inode/directory". | |
try { | |
// HTMLInputElement.webkitdirectory | |
// https://wicg.github.io/entries-api/#dom-htmlinputelement-webkitdirectory | |
var html = `<form |
// deno bundle https://raw.githubusercontent.com/kawanet/sha1-uint8array/main/lib/sha1-uint8array.ts sha1-uint8array-bundle.js | |
// bun build --minify sha1-uint8array-bundle.js --outfile=sha1-uint8array.min.js | |
var z=function(t){if(t&&!w[t]&&!w[t.toLowerCase()])throw new Error("Digest method not supported");return new E},p=function(t,e,i,s){if(t===0)return e&i|~e&s;if(t===2)return e&i|e&s|i&s;return e^i^s},B=function(){return new Uint8Array(new Uint16Array([65279]).buffer)[0]===254},y=[1518500249|0,1859775393|0,2400959708|0,3395469782|0],w={sha1:1};class E{A=1732584193|0;B=4023233417|0;C=2562383102|0;D=271733878|0;E=3285377520|0;_byte;_word;_size=0;_sp=0;constructor(){if(!u||_>=8000)u=new ArrayBuffer(8000),_=0;this._byte=new Uint8Array(u,_,80),this._word=new Int32Array(u,_,20),_+=80}update(t){if(typeof t==="string")return this._utf8(t);if(t==null)throw new TypeError("Invalid type: "+typeof t);const{byteOffset:e,byteLength:i}=t;let s=i/64|0,r=0;if(s&&!(e&3)&&!(this._size%64)){const h=new Int32Array(t.buffer,e,s*1 |