Git Product home page Git Product logo

waveformlistener's Introduction

WaveformListener

This package is a tool to restore sound from waveform images.

The general procedure is:

  1. Find the max and min points of each column of waveform pixles
  2. Upsample to a higher sample rate (44.1kHz by default) by 3rd-order spline interpolation given the condition that the derivative at all the max and min points is 0
  3. Apply a lowpass filter to reduce the frequencies that are impossible to be restored from the waveform image.

Command line usage

julia <path/to/the/project>/cli/readwf.jl [OPTIONS]... IMAGE_FILE R G B DURATION

positional arguments:
  IMAGE_FILE           Path to the waveform image file
  R                    Red value of the waveform colour (0~255)
  G                    Green value of the waveform colour (0~255)
  B                    Blue value of the waveform colour (0~255)
  DURATION             Duration of the sound in seconds

options:
  --max-colour-delta MAX-COLOUR-DELTA
                        Maximum colour difference allowed for a pixel to be counted
                        as part of the waveform. Try increasing if the waveform is
                        not read in whole

  -o, --output OUTPUT_FILE
                        Path to the output audio file

  -q, --quiet           Turn off printing

Examples:

Assuming the current path is the project home path

julia ./cli/readwf.jl ./examples/eg1.png 59 153 105 0.692

The above will generate a WAV file at the current path

Or you can specify the output file path (and the project environment):

julia --project=. ./cli/readwf.jl -o ./examples/eg1.wav ./examples/eg1.png 59 153 105 0.692

waveformlistener's People

Contributors

coldinjection avatar

Stargazers

 avatar

Watchers

 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.