Code Monkey home page Code Monkey logo

py-sound-viewer's Introduction

Sound Viewer (Python)

[May 2020 - Update in Jan 2023]

Acknowledgments: Based on the work by Yu-Jie Lin (Public Domain) Github: https://gist.github.com/manugarri/1c0fcfe9619b775bb82de0790ccb88da

License: CC0 (Public Domain) - see the file in the archive for more info

TL;DR

demo

A test audio file of some fingers snapping is provided with the scripts to easily try out the project (it will create the video above).

Here is the entire process to get a fully finished video:

  1. (optional) Start a virtual environment

  2. Install the Python packages:

    ~$ pip install -r requirements.txt

  3. Convert the test audio file, which is mono, to stereo:

    ~$ bash convert_to_stereo.sh test

  4. Create the video from the sound file:

    ~$ python main.py -m bars -c "#ddddff" --output test_stereo

  5. Merge the video and the audio:

    ~$ bash add_audio_to_video.sh -a test_stereo -v test_stereo

  6. Your final video is now available: it's the test_stereo_processed.mp4 file :)

Options

The Python script accepts the following options:

  • -m/--method: the type of graph to create - can be: bars, spectrum, wave or rain
  • -c/--color: the color of the visualizatio - can be a specific color in hexadecimal format (e.g. "#ddddff") or "hue_rotate" (default) to have the color auto-update throughout the film
  • --output/--no-output: whether to save the result in a file or display it directly

Disclaimers

  • All bash scripts use ffmpeg, so you need to install it first if you don't have it yet (https://ffmpeg.org/).
  • For now, the project only works with .wav and .mp4 files.
  • All scripts and commands except file names WITHOUT their extension.
  • The Python script doesn't automatically merge the audio and video (see step 4).

py-sound-viewer's People

Contributors

minapecheux avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.