How to use the nexusui/dist/NexusUI.js.Spectrogram function in nexusui

To help you get started, we’ve selected a few nexusui examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mimic-sussex / sema / src / index.js View on Github external
function createNexusUI() {

  // window.AudioEngine.initWithAudioContext(NexusUI.context);	
	let analysers = document.getElementsByClassName("analysers");
	
	NexusUI.context = window.AudioEngine.audioContext; 
	oscilloscope = new NexusUI.Oscilloscope("oscilloscope", {
		// size: default
	});
	oscilloscope.colorize("fill", "#000");
	oscilloscope.colorize("accent", "#FFF");
	// window.AudioEngine.addAnalyser(oscilloscope); // Inject oscilloscope analyser, keep encapsulation for worklet node
	oscilloscope.connect(window.AudioEngine.audioWorkletNode);

	spectrogram = new NexusUI.Spectrogram("spectrogram", {
		// size: [100, 50]
	});
	spectrogram.colorize("fill", "#000");
	spectrogram.colorize("accent", "#FFF");
	// window.AudioEngine.addAnalyser(spectrogram); // Inject oscilloscope analyser, keep encapsulation for worklet node
	spectrogram.connect(window.AudioEngine.audioWorkletNode);

	window.addEventListener("resize", function(event) {
		// oscilloscope.resize(100, 120);
		// spectrogram.resize(100, 150);
		// console.log(analysers);
	});

	// window.AudioEngine.connectAnalysers();
}