Skip to content

Instantly share code, notes, and snippets.

@jwalton922
jwalton922 / .tsx
Created June 30, 2022 23:52
Attempt at Extracting Text Faster than Playback
const beforeUpload=(file:any) =>{
console.log("Upload beforeUpload",file);
var reader = new FileReader();
const _audioContext = new OfflineAudioContext(1, 48000 * 1, 48000);
reader.readAsArrayBuffer(file);
reader.onloadend = (evt) => {
if (evt.target?.readyState === FileReader.DONE) {
console.log("File reader is done");
{
"correlationId": "UUID",
"totalCount": 1,
"itemCount": 1,
"page": 1,
"pageSize": 1,
"productId": "eText",
"courseSectionId": "59cc16f2e4b0f389a4688b44",
"timePeriod": "ALL",
"startDateTime":"2018-01-31T06:00:00Z",
{
"correlationId": "UUID",
"totalCount": 1,
"itemCount": 1,
"page": 1,
"pageSize": 1,
"productId": "eText",
"courseSectionId": "59cc16f2e4b0f389a4688b44",
"timePeriod": "ALL"
"data": [
type LearningResource{
learningResourceId: ID
name: String
type: String
level: String
contextId: ID
sequenceNumber: Int
children: [LearningResource]
}
##############
Query for Activity Last Seven Days
{
temporalEngagement(courseSectionId: "cs1",
filter: {timeWindow: {gte: "2018-02-02T00:00:00", lt: "2018-02-05T00:00:00"}},
timeBin: day,
sortBy: "timeBin"
sortOrder: asc
) {
totalCount
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.pearson.engagement;
import com.pearson.autobahn.AutobahnMessage;
import com.pearson.autobahn.SparkReader;
import com.pearson.graphdatagenerator.EngagementData;
QUERY
{
engagementQueryV3(
courseSectionId: ["cs1"],
reportingContextId:["book1"],
learningResourceId: ["book1"],
filter: {
timeWindow: {
gt: "2018-01-30"
lte: "2018-01-21"
{
"correlationId": "UUID",
"totalCount": 2,
"itemCount": 2,
"page": 1,
"pageSize": 2,
"productId": "eText",
"courseSectionId": "59cc16f2e4b0f389a4688b44",
"timePeriod": "DAY",
"startDateTime":"2018-02-15T06:00:00Z",