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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file easymix-0.0.9.tar.gz.

File metadata

  • Download URL: easymix-0.0.9.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.2

File hashes

Hashes for easymix-0.0.9.tar.gz
Algorithm Hash digest
SHA256 eb54eb879f1cc497af92a076033a59e0d20529347e8bb673ce6668a591e49a3e
MD5 1b7b6551c7a3cae10b80724cd60716e7
BLAKE2b-256 363e763a8631dac266a3c921f441812e16885103436f9a3a5b97d05e2d780051

See more details on using hashes here.

File details

Details for the file easymix-0.0.9-py3-none-any.whl.

File metadata

  • Download URL: easymix-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 12.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.2

File hashes

Hashes for easymix-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 efa3a515effbe14c6a87cedf5d0897446253a00878f77e9ef86fe8d607da5059
MD5 2f9d9c5f787841fb95b25871f717cf2c
BLAKE2b-256 a3e73af4e492a42d325ea2f2674fb727675e059df4bcf63aba9cf68bf7327503

See more details on using hashes here.

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