Giter Club home page Giter Club logo

audio-effects's Introduction

Audio Effects

Multiple types of audio effects will be described and implemented in python.

Table of Contents

Getting Started

All of these implementations will be in python and therefore will utilize the pyaudio module. I would suggest to use python 2.7 since some of the other modules I will be using will not be compatible with the 3+ version. By default, pip and setuptools will already be installed however they will need to be upgraded:

For windows:

python -m pip install -U pip setuptools

For Linux or OSX:

sudo pip install -U pip setuptools

For those with faith:
You can download this python script which should install pip upon running:

python get-python.py

Now, in order to install the pyaudio module simply type the following into the terminal:

sudo pip install pyaudio

If you run into an error, you may have to install manually by downloading the corresponding wheel and using pip. The wheels can be found at http://www.lfd.uci.edu/~gohlke/pythonlibs/

In order to install, simply download the wheel and move it to your current directory. Then type:

pip install (Name of your wheel).whl

Playing files

Initialize:

p = pyaudio.PyAudio()

stream = p.open(format      = pyaudio.paInt16,
                channels    = num_channels,
                rate        = Fs,
                input       = False,
                output      = True )

Reading/Editing/Playing:

input_string = wf.readframes(1)          # Get first frame
while input_string != '':

    # Convert string to number
    input_tuple = struct.unpack('h', input_string)  # One-element tuple
    input_value = input_tuple[0]                    # Extract number from tuple

    # Compute output value
    output_value = gain * input_value               # Multiple value by set gain

    # Convert output value to binary string
    output_string = struct.pack('h', output_value)  

    # Write output value to audio stream
    stream.write(output_string)                     

    # Get next frame
    input_string = wf.readframes(1) 

Using Pyaudio

Effects

Blocking

Callback

Visualization with Pyplot

audio-effects's People

Contributors

souloist avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

danishack

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.