Coder Social home page Coder Social logo

shalevy1 / webgl-spectrogram Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bastibe/webgl-spectrogram

0.0 0.0 0.0 1 MB

A smoothly animated spectrogram display in WebGL (FFT in Python/Tornado)

Makefile 1.16% JavaScript 75.26% HTML 6.40% Python 17.19%

webgl-spectrogram's Introduction

WebGL-Spectrogram

Get running in 5 minutes

First, check out WebGL-Spectrogram and launch it locally:

git clone https://github.com/bastibe/WebGL-Spectrogram.git
cd WebGL-Spectrogram

We have some installation commands that utilize brew, yum, and apt-get based on your system and package manager preference.

All Python packages are install using pip from the requirements.txt file. If you wish to install via another method i.e. conda, all the packages and versions can be found in requirements.txt.

The commands below install common packages for OSX or Linux and run the server.

Note: You need to use sudo if you are not working in a virtualenv.

If you are not using OSX, the apt-get manger is used by default.

To use yum to install packages instead, run make installdeps RPM=1.

make installdeps
make run

A webpage should now open and you can select the file example.wav to generate a sample spectrogram.

About

This is a small local web app that displays a spectrogram of an audio signal in the browser using WebGL. It is known to work with Firefox and Chrome, though performance is best in Firefox.

The spectrogram display can be zoomed and panned smoothly and has a configurable FFT length. The amplitude range can be adjusted on the fly as well. It can open any local .wav or .flac file.

screenshot

server.py contains a small web server written in Python and Tornado that responds to messages on ws://localhost:XXXX/spectrogram, where XXXX is a random port in the local range. Currently, it supports two kinds of messages: One that requests a spectrogram from a file name, and another that requests a spectrogram from a file content attached to the message. It responds to these messages with a message containing a full spectrogram for the given audio file.

communications.js contains the Javascript implementation of the messaging protocol.

specsize.js contains a helper class for storing the extent of a spectro-temporal display.

spectrogram.js contains Javascript code that can load audio files and request spectrograms from the server, and draw those spectrograms using WebGL. It also contains a time and frequency scale and a small indicator that shows the cursor position in time/frequency coordinates.

main.html contains the website used to display the spectrogram.

The messaging protocol is JSON-based, easily extensible and supports transmission of textual or binary data.

webgl-spectrogram's People

Contributors

bastibe avatar hadatko avatar joshblum avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.