Skip to content

Commit

Permalink
build(utilities): release version 0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
julianpoemp committed Nov 13, 2024
1 parent f38ce61 commit 33dcf05
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 1 deletion.
10 changes: 10 additions & 0 deletions libs/utilities/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).

# [0.1.0](https://github.com/IPS-LMU/octra/compare/utilities-0.0.12...utilities-0.1.0) (2024-11-13)


### Features

* **utilities:** moved TsWorker classed to utilities package ([5ba6838](https://github.com/IPS-LMU/octra/commit/5ba68383aafa88cf9077f83e09cfdeff541fa66a))
* **utilities:** new stringifyQueryParams() function ([f38ce61](https://github.com/IPS-LMU/octra/commit/f38ce612a7155e1c65ecd5b70706be7bb15f87b6))



## [0.0.12](https://github.com/IPS-LMU/octra/compare/utilities-0.0.11...utilities-0.0.12) (2024-03-25)


Expand Down
2 changes: 1 addition & 1 deletion libs/utilities/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@octra/utilities",
"description": "This library offers JS functions and classes to make some parts of app development easier. This library is used by [Octra](https://github.com/IPS-LMU/octra) and Octra-Backend.",
"version": "0.0.12",
"version": "0.1.0",
"license": "MIT",
"private": false,
"author": {
Expand Down
66 changes: 66 additions & 0 deletions tests/audio-decode-test.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Title</title>
<script type="application/javascript">
const FILES_FOR_TESTTING = [
//"TestBig100.mp3",
"TestBig133.flac",
//"TestBig124.m4a",
"TestBig150.ogg",
"TestBig150.wav",
//"TestBig153.m4a",
// "TestBig187.m4a",
//"TestBig200.mp3",
"TestBig181.flac",
"TestBig200.ogg",
"TestBig267.flac",
"TestBig292.ogg",
//"TestBig300.mp3",
"TestBig321.wav"
];
pointer = -1;

console.log(document.location.href);
const matches = /(https?:\/\/.*\/)([^?]+)(\?.*)*/g.exec(
document.location.href
);
const baseHref = matches[1];
const htmlFile = matches[2];
const query = matches[3];

let testButton;
window.addEventListener('load', async () => {
console.log('LOADED');
testButton = document.getElementById("testButton");
testButton.addEventListener("click", onTestButtonClick);
});

async function onTestButtonClick(ev) {
for (let i = 0; i < FILES_FOR_TESTTING.length; i++) {
const file = FILES_FOR_TESTTING[i];
console.log(`Test file ${file}`);
let arrayBuffer = await fetch(`${baseHref}testfiles/${file}`);
arrayBuffer = await arrayBuffer.arrayBuffer();
console.log(`-> File has size of ${arrayBuffer.byteLength}...`);
let t = Date.now();

try {
console.log("-> Decode...");
const audiobuffer = await new AudioContext().decodeAudioData(arrayBuffer);
console.log(`-> SUCCESS with ${audiobuffer.length} samples after ${(Date.now() - t) / 1000} seconds`);
} catch (e) {
console.log("-> ERROR");
console.error(e);
}
}

console.log("FINISHED ALL!");
}
</script>
</head>
<body>
<button id="testButton">TEST</button>
</body>
</html>

0 comments on commit 33dcf05

Please sign in to comment.