-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments #1
Comments
This is awesome! What is the cause of all of the "holes" in the waterfall output? Is that a rendering artifact, or some actual property of the music? |
That's because of interference between frequencies. |
Awesome work on this! I have been searching for something nice like this that I can incorporate into a website I am developing, for live audio streaming. All that I have found are either ones that will play an audio stream from a URL, but the animation does not work, or the animation works, but only seems to play a file loaded from the local computer. Do you know of a tweek that would make this work with an audio stream URL? (this is the URL: http://de1.internet-radio.com:8106/stream ) |
Probably, this is CORS issue. Maybe, try it with audio stream from your website instead of external website. Thank's. |
Thx for responding! If you mean running your code on the server the stream originates from, that is not possible — it is a streaming server I do not have access to. What is CORS? |
Thx again. With another bit of code, I’ve been able to get audio and a visualizer working, but is so basic, not looking anything nice like yours. Part of what I did was add the audio.crossdomain =“anonymous”; line. What I’d really like to donis get your visualizer working with my ausio stream. Also, is there an option for not showing the musical scale, and just show the waveform? |
Probably, you want to use // include showcqtbar.js
// prepare audio_ctx, canvas, canvas_ctx, analyser_l, analyser_r
var bar_v = 17;
var sono_v = 17;
var cqt = new ShowCQTBar(audio_ctx.sampleRate, canvas.width, canvas.height - 4, /* add 4 pixels axis */
bar_v, sono_v, 1);
analyser_l.fftSize = cqt.fft_size;
analyser_r.fftSize = cqt.fft_size;
var buffer_l = cqt.get_input_array(0);
var buffer_r = cqt.get_input_array(1);
var line_buffer = cqt.get_output_array();
var canvas_buffer = canvas_ctx.createImageData(canvas.width, canvas.height);
function draw() {
requestAnimationFrame(draw);
analyser_l.getFloatTimeDomainData(buffer_l);
analyser_r.getFloatTimeDomainData(buffer_r);
cqt.calc();
for (var y = 0; y < canvas.height; y++) {
cqt.render_line(y, 255 /* opaque */);
canvas_buffer.data.set(line_buffer, 4 * canvas.width * y);
}
canvas_ctx.putImageData(canvas_buffer, 0, 0);
}
requestAnimationFrame(draw); |
No description provided.
The text was updated successfully, but these errors were encountered: