Giter VIP home page Giter VIP logo

pywave's Introduction

PyWave

A python script for extracting and visualizing sound waves from audio files.

API

This script is based on the builder pattern which easily lets you customize the settings.

wave = (
    SoundWave
    .from_url(url='https://some_url/my_music.mp3')
    .with_bar_count(50)
    .with_skip_percent(0.75)
    .using_average()
    .process()
    .visualize(bar_height=50, bar_width=5)
    .delete_file()
).data

Output

soundwave

Available Methods

Initializers

You can initialize the SoundWave class using the 3 available class methods, from_file, from_url, from_path to provide your audio data from a file, direct url, or from a path on your device.

with_bar_count(count: int)

change the number of output bars, default is set to 50

with_skip_percent(ratio: float)

set a percentage of data to be ignored in order to speed up the process. it is recommended to use 0.5 or higher

using_maximum()

use the maximum function when processing the given data

using_average()

use the average function when processing the given data

visualize(bar_height: int, bar_width: int)

draw the processed sound wave

delete_file()

would delete the files after processing them

data

calculated property, returns a list of bar heights as int percentage, 100 being the maximum. This is to provide an efficient way to store the data as a blob of UInt8 values.

pywave's People

Contributors

sh4yy avatar

Stargazers

 avatar

Watchers

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