Skip to content

Instantly share code, notes, and snippets.

View heyaphra's full-sized avatar

Aphra Bloomfield heyaphra

View GitHub Profile
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
import { Menu, Dropdown, Icon, Button } from 'antd';
class App extends Component {
constructor() {
super();
this.state = {
isPlaying: false, /* Is audio currently playing? (Boolean) */
@heyaphra
heyaphra / Demos.js
Last active December 29, 2018 01:32
/* The examples below utilize the Chrome Team's code practically verbatim, with the exception of some
slight modifications. Demos that produce sounds with discrete start and finish times are adjusted using
the AudioContext's currentTime so they may be re-triggered using the start/stop button.
Additionally, each function returns an AudioWorkletNode registered to a AudioWorkletProcessor
so that we can start and stop audio by sending messages between the App and the AudioWorklet processor.
We will create our AudioWorkletProcessors in the next step!*/
export const Bypasser = (App) => {
const { actx } = App;
const bypasserNode = new AudioWorkletNode(actx, 'bypass-processor');
const oscillator = actx.createOscillator();
/**
* Copyright 2018 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
/**
* Copyright 2018 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
/**
* Copyright 2018 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
/**
* Copyright 2018 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
/* loadModule: given a module's name, adds it to the audioWorklet */
async loadModule() {
const { state, actx } = this;
try {
await actx.audioWorklet.addModule(`worklet/${state.processor.name}.js`);
this.setState({moduleLoaded: true, status: null})
console.log(`loaded module ${state.processor.name}`);
} catch(e) {
this.setState({moduleLoaded: false})
console.log(`Failed to load module ${state.processor.name}`);
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
import { Menu, Dropdown, Icon, Button } from 'antd';
import { Bypasser, onePoleFilter, noiseGenerator, bitCrusher } from './Demos'
class App extends Component {
constructor() {
super();
this.state = {
@heyaphra
heyaphra / package.json
Created July 30, 2019 20:22 — forked from jthomas/package.json
Using TensorFlow.js with MobileNet models for image classification on Node.js
{
"name": "tf-js",
"version": "1.0.0",
"main": "script.js",
"license": "MIT",
"dependencies": {
"@tensorflow-models/mobilenet": "^0.2.2",
"@tensorflow/tfjs": "^0.12.3",
"@tensorflow/tfjs-node": "^0.1.9",
"jpeg-js": "^0.3.4"

Keybase proof

I hereby claim:

  • I am spidercatnat on github.
  • I am spidercatnat (https://keybase.io/spidercatnat) on keybase.
  • I have a public key ASD5R9F7YYqCrmyiEfLKleTmOpe2QcZIcpfXxPw3c59-ngo

To claim this, I am signing this object: