[Request] library for audio analysis

For developers using the Construct 2 Javascript SDK

Post » Mon Dec 05, 2016 6:40 pm

Found this via reddit. any chance to get it as a Plugin or FX?

Javascript music analysis library
https://github.com/wizgrav/clubber/

Clubber is a small library that analyzes the frequency data from an audio source and extracts rhythmic information. The processing takes the music key into account and outputs data in a form suitable for direct use in webgl shaders. It is a step above simple beat detection and allows for rapid creation of visualisations that sync pleasantly with the audio.
demo: http://wizgrav.github.io/clubber/
B
80
S
29
G
165
Posts: 233
Reputation: 88,617

Post » Tue Dec 06, 2016 6:13 am

Yeah hopefully @Ashley can add this in for the next update.
https://developer.mozilla.org/en-US/doc ... _Audio_API
B
52
S
26
G
8
Posts: 121
Reputation: 8,526

Post » Tue Dec 06, 2016 6:48 am

@adcornaglia
That bit is already implemented in C2.
B
94
S
33
G
118
Posts: 5,394
Reputation: 75,849

Post » Tue Dec 06, 2016 7:00 am

@R0J0hound I can analyze the audio from my speakers in C2? IE: Have it analyze anything from what's playing in VLC to a Mic/Line-in? If so please educate me good sir XDDDDDDDDDD.
B
52
S
26
G
8
Posts: 121
Reputation: 8,526

Post » Tue Dec 06, 2016 7:38 am

Off the top my head there is the audio analyzer example bundled with C2. It works with sounds you play from your game. To use it with you mic add the userMedia object to access it, and it then is tied in with the audio plugin. line out/line in aren't accessible as far as I know.
B
94
S
33
G
118
Posts: 5,394
Reputation: 75,849

Post » Tue Dec 06, 2016 8:52 am

@adcornaglia

Thread of analyzing mic input

BTW, this topic is not EFFECT, it is plugin/behavior.
B
110
S
28
G
280
Posts: 4,487
Reputation: 156,566

Post » Tue Dec 06, 2016 9:20 am

The interessting part for me to read was "outputs data in a form suitable for direct use in webgl shaders".
if this is possible the i must RTFM and study C2 more.
Sorry, for posting to a wrong section.
B
80
S
29
G
165
Posts: 233
Reputation: 88,617

Post » Tue Dec 06, 2016 9:25 am

@totoe

It might be 3 steps

1. ability to get input data
2. processing data
tone.js plugin could get mic data and analyze the amplitude, like official audio does. (step 1, 2)

3. present data, might show by sprites or draw on canvas.
B
110
S
28
G
280
Posts: 4,487
Reputation: 156,566

Post » Wed Dec 07, 2016 2:23 am

rexrainbow wrote:@totoe

It might be 3 steps

1. ability to get input data
2. processing data
tone.js plugin could get mic data and analyze the amplitude, like official audio does. (step 1, 2)

3. present data, might show by sprites or draw on canvas.

@rexrainbow . Yes, thank you seen that. It is completely unnecessary and impractical in it's current state though. Music analysis needs to be down to the second if not millisecond in some cases.

The HTML5 API is already in place, it just needs to be integrated. Not to mention I'm not a fan of relying on a plugin somebody else made. Also, MediaStreamAudioSourceNode Interface: covers microphone input live, also just would need to be integrated. https://dvcs.w3.org/hg/audio/raw-file/t ... SourceNode


@Ashley , @R0J0hound Here are two methods of html5 live audio input:
https://www.html5rocks.com/en/tutorials ... dia/intro/
&
https://developers.google.com/web/updat ... ut-Enabled:
// success callback when requesting audio input stream
function gotStream(stream) {
window.AudioContext = window.AudioContext || window.webkitAudioContext;
var audioContext = new AudioContext();

// Create an AudioNode from the stream.
var mediaStreamSource = audioContext.createMediaStreamSource( stream );

// Connect it to the destination to hear yourself (or any other node for processing!)
mediaStreamSource.connect( audioContext.destination );
}

navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia;
navigator.getUserMedia( {audio:true}, gotStream );
B
52
S
26
G
8
Posts: 121
Reputation: 8,526

Post » Thu Dec 08, 2016 7:03 am

rexrainbow wrote:@adcornaglia

Thread of analyzing mic input

BTW, this topic is not EFFECT, it is plugin/behavior.

@rexrainbow meant that reply about this.

@R0J0hound shouldn't this topic should be under Javascript SDK since it's actually to do with Construct 2's functionality of the audio API and not effects except as an end result?
B
52
S
26
G
8
Posts: 121
Reputation: 8,526


Return to Javascript SDK

Who is online

Users browsing this forum: No registered users and 0 guests