Skip to main content

AudioPod SDK for Python - Professional Audio Processing powered by AI

Project description

AudioPod Python SDK

Official Python SDK for AudioPod AI - Professional Audio Processing powered by AI.

Installation

pip install audiopod

Quick Start

from audiopod import Client

# Initialize client
client = Client(api_key="ap_your_api_key")
# Or set AUDIOPOD_API_KEY environment variable

# Check wallet balance
balance = client.wallet.get_balance()
print(f"Balance: {balance['balance_usd']}")

# Extract stems from audio
job = client.stem_extraction.extract_stems(
    audio_file="song.mp3",
    stem_types=["vocals", "drums", "bass", "other"],
    wait_for_completion=True
)

# Download stems
for stem, url in job["download_urls"].items():
    print(f"{stem}: {url}")

Services

Wallet (API Billing)

# Get balance
balance = client.wallet.get_balance()

# Get pricing
pricing = client.wallet.get_pricing()

# Estimate cost
estimate = client.wallet.estimate_cost("stem_extraction", duration_seconds=300)

# Top up wallet
checkout = client.wallet.create_topup_checkout(amount_cents=2500)  # $25
print(f"Pay at: {checkout['url']}")

# Usage history
usage = client.wallet.get_usage_history(page=1, limit=50)

Stem Extraction

# Extract all stems
job = client.stem_extraction.extract_stems(
    audio_file="song.mp3",
    stem_types=["vocals", "drums", "bass", "other"],
    wait_for_completion=True
)

# From URL
job = client.stem_extraction.extract_stems(
    url="https://example.com/song.mp3",
    stem_types=["vocals", "other"]
)

# Check status
status = client.stem_extraction.get_job(job_id=123)

Transcription

# Transcribe audio
result = client.transcription.transcribe(
    audio_file="podcast.mp3",
    speaker_diarization=True,
    wait_for_completion=True
)
print(result["transcript"])

Voice Cloning & TTS

# List voices
voices = client.voice.list_voices()

# Generate speech
audio = client.voice.generate_speech(
    text="Hello, world!",
    voice_id=123,
    wait_for_completion=True
)

Music Generation

# Generate music
result = client.music.generate(
    prompt="upbeat electronic dance music",
    duration=30,
    wait_for_completion=True
)

Noise Reduction

# Denoise audio
result = client.denoiser.denoise(
    audio_file="noisy.mp3",
    mode="studio",
    wait_for_completion=True
)

Async Support

import asyncio
from audiopod import AsyncClient

async def main():
    async with AsyncClient() as client:
        balance = await client.wallet.get_balance()
        print(f"Balance: {balance['balance_usd']}")

asyncio.run(main())

Error Handling

from audiopod import Client
from audiopod.exceptions import (
    AuthenticationError,
    InsufficientBalanceError,
    RateLimitError,
    APIError
)

try:
    client = Client()
    job = client.stem_extraction.extract_stems(audio_file="song.mp3")
except AuthenticationError:
    print("Invalid API key")
except InsufficientBalanceError as e:
    print(f"Need to top up: required {e.required_cents} cents")
except RateLimitError:
    print("Rate limit exceeded, try again later")
except APIError as e:
    print(f"API error ({e.status_code}): {e}")

Documentation

License

MIT

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

audiopod-2.2.0.tar.gz (18.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

audiopod-2.2.0-py3-none-any.whl (25.2 kB view details)

Uploaded Python 3

File details

Details for the file audiopod-2.2.0.tar.gz.

File metadata

  • Download URL: audiopod-2.2.0.tar.gz
  • Upload date:
  • Size: 18.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for audiopod-2.2.0.tar.gz
Algorithm Hash digest
SHA256 8abdfc63003ad3a7ca9cb0f411da1e86c3bed5ceea5eee16cd2a75413138153f
MD5 6089b2374e03e282a05d03af6bfe80a1
BLAKE2b-256 a201f7a46f45ac3f31aa0421c0d94e7978ec96e18531664275de983053fadb98

See more details on using hashes here.

File details

Details for the file audiopod-2.2.0-py3-none-any.whl.

File metadata

  • Download URL: audiopod-2.2.0-py3-none-any.whl
  • Upload date:
  • Size: 25.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for audiopod-2.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0403f9f6b8312ea11249b9281d7104ad9616619a96368fb3ef0b5e2ced622f80
MD5 5fff6ef9b3a59c37370ba7ea74ae52a4
BLAKE2b-256 a5f288fb69dd2c265c4f1f1d4658ed15e089f4022d4dd9d6cdf3b8dac2d6db74

See more details on using hashes here.

Supported by

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