Skip to main content

Simple live and track python audio mixer

Project description

Usage

Live Audio Mixer

import easymix as mixer
import time

def liveMix():
    mixer.play('01.mp3')
    for i in range(5):
        mixer.play('02.mp3')
        time.sleep(2)

    mixer.stop()

Compose Audio track

import easymix as mixer

def composeTrack():
    track = mixer.Track()
    track.addSound('01.mp3', 1.0)
    for t in range(5):
        track.addSound('02.mp3', t)

    track.save('track.mp3')

You can also define the sounds as pydub audio segments. It's convenient in case you need to apply effects on the sounds before playing, such as volume adjustment.

import pydub

sound01 = pydub.AudioSegment.from_file('01.mp3')

sound01 -= 5	# reduce 5dB

...
mixer.play(sound01)

...
track.addSound(sound01, 1.0)

Setup

Install pip package

pip3 install easymix

Known issues

This is only a prototype. Beware of the following issues which require proper investigation:

  1. The pyaudio package installation fails with Python 3.11.4, but works with Python 3.9.2.
  2. The sounds might be played at higher speed than expected (bit rate issue)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

easymix-0.0.9.tar.gz (11.5 kB view hashes)

Uploaded Source

Built Distribution

easymix-0.0.9-py3-none-any.whl (12.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page