ap_ds ap_ds v4.0.1

ap_ds: A Lightweight Python Audio Library

2.5MB for audio playback and metadata parsing — no external decoder required

v4.0.1 Only 2.5MB Cross-platform W/M/L

1. Overview

Official resources

Project: ap_ds

Official site: https://apds.top

PyPI:https://pypi.org/project/ap_ds/

Maintainer: Dvs (DvsXT)

ap_ds is a lightweight (2.5MB) Python audio library for playing and parsing MP3, FLAC, OGG and WAV files. It depends on no third-party Python packages — only the standard library and the system-provided SDL2.

v3.0.0 LTS (Long-Term Support)

Our first long-term support release, with five years of maintenance and free technical support, suited to projects that need dependency stability.

2. Capabilities

Footprint
Windows 2.5MB · macOS 3.36MB · Linux varies by distribution
Format support
MP3 / FLAC / OGG / WAV
Metadata parsing
100% accurate for WAV / FLAC
Non-blocking playback
Does not block the GUI thread

Size comparison

  • ap_ds Windows: 2.5MB
  • macOS: 3.36MB
  • Linux: ~50KB dynamically linked
  • FFmpeg: ≥160MB
  • Pygame + other deps: different footprint/feature tradeoff

Why the footprint is this small

  • Playback and parsing only — no editing or transcoding
  • Built on industrial-grade SDL2
  • Resources released on demand
  • Cross-platform W / M / L

3. Comparison

Approach 1: Pygame duration retrieval

# Unreliable duration retrieval in Pygame for non-WAV formats
my_sound = pygame.mixer.Sound('my_song.mp3')
total_length = my_sound.get_length()  # WAV only
Pygame's Sound.get_length() is accurate only for WAV; MP3 / OGG / FLAC return invalid values.

Approach 2: FFmpeg bundle size

ApproachCapabilitySize
ffplay.exeDuration retrieval≈80MB
ffprobe.exeMetadata parsing≈80MB
ffmpeg.exeTranscoding≈80MB
Shipping FFmpeg requires distributing its executable, adding roughly 160MB to a Python installation.

Approach 3: what ap_ds does

Highlight

  • 2.5MB instead of 160MB
  • No third-party GUI framework
  • Precise duration query
  • Non-blocking playback
  • AID audio handles
  • SDL2 backend
  • Single C extension, cross-platform

4. Install & Usage

pip install ap_ds

Basic example

from ap_ds import AudioLibrary

lib = AudioLibrary()
aid = lib.play_from_file("music.mp3")
lib.pause_audio(aid)
lib.seek_audio(aid, 30.5)
duration = lib.stop_audio(aid)

DAP playlist (v2.3.0+)

aid1 = lib.play_from_file("song1.mp3")
recordings = lib.get_dap_recordings()
lib.save_dap_to_json("my_playlist.ap-ds-dap")

Fade in/out (v2.4.0+)

# 2s fade in
lib.fadein_music(aid, loops=-1, ms=2000)

# 3s fade out
lib.fadeout_music(ms=3000)

# query playback state
if lib.is_music_playing():
    print("playback finished")

5. Open Source License

This project does not use the MIT License

ap_ds is released under its own DVS Audio Library (ap_ds) Open Source License (AP_DS-OSL) 2.0.

You may

  • Use commercially
  • Modify the code
  • Integrate into closed-source projects
  • Sell solutions built on it
  • Deploy as a cloud service

You may not

  • Use the original brand name
  • Remove copyright notices
  • Use it for illegal purposes
  • File patent infringement suits

You should

  • Keep copyright notices
  • Attribute the source
  • Report security issues
  • Use a distinct brand for modified versions

See AP_DS_LICENSE.MD for the full license text.

Read the full license (AP_DS-OSL 2.0)

6. FAQ

Q: Can my company integrate it into a commercial product?

Absolutely — no fee, no notice, no permission required.

Q: May I modify and redistribute it?

Yes — but you must use a distinct brand, keep the copyright, attribute the source and provide a maintainer statement.

Q: Do I have to open-source my changes?

No, you may distribute them as closed source.

Q: Is there a fee to use it in a cloud service?

No, but code contributions are welcome.

Q: Is technical support paid?

Technical support is free forever — reach us via GitCode Issues or email.

7. Contact & Support

Licensing Enquiries

me@dvsyun.top or dvs6666@163.com

Reply within 7 business days

Technical Support

GitCode Issues · Documentation · Email

Free forever

Official Repositories

Primary:GitCode

Mirror:Gitee

Deprecated:GitHub

Homepage:apds.top

8. Announcements

Loading...