Skip to main content

Cross-platform audio playback/recording (C++/PortAudio/ASIO/WASAPI) with Python bindings

Project description

paudio - Windows audio playback/recording with PortAudio/ASIO/WASAPI and Python bindings

概要 Windows上でオーディオのデバイス列挙・再生・録音(ASIO、WASAPIループバック)を提供するC++実装と、そのPythonバインディングです。CLI実行とPython APIの両方が利用できます。

インストール pipでインストール可能(PyPI公開後):

pip install paudio

Pythonの使い方 デバイス一覧(標準出力へ表示)

import paudio
paudio.list_devices()

再生(非ブロッキング制御)

import time, paudio

p = paudio.Player()
p.load("C:/music/test.wav")
p.start()
while p.is_playing():
    time.sleep(0.1)
p.stop()

録音(非ブロッキング制御)

import time, paudio

r = paudio.Recorder()
# デフォルトデバイスへ録音
r.setup("C:/recordings/out.wav")
r.start()
time.sleep(5)
r.stop()

# ASIOでチャンネル範囲(1ベース)。例: 44-54 は11ch
# r.setup("C:/recordings/out.wav", device_index=5, channels=(44, 54))

主な機能

  • デバイス列挙(WASAPI/ASIO、WASAPIループバックの表示)
  • WAV再生(16/24/32bit PCM、簡易リサンプル)
  • 録音:
    • WASAPIループバック(システム音、2ch)
    • ASIO(チャンネル範囲指定対応、1ベース)

注意

  • WASAPIループバックは2ch固定です。
  • 通常WASAPI入力は先頭Nchの取得のみで、中腹からのチャンネル範囲指定は未対応です。

ライセンス MIT(本プロジェクト)。PortAudioおよびASIO SDKの各ライセンスに従います。

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

py_p_audio-0.1.0.tar.gz (627.6 kB view details)

Uploaded Source

File details

Details for the file py_p_audio-0.1.0.tar.gz.

File metadata

  • Download URL: py_p_audio-0.1.0.tar.gz
  • Upload date:
  • Size: 627.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for py_p_audio-0.1.0.tar.gz
Algorithm Hash digest
SHA256 aca0a0bf055a55bc5b54667c626047ac0a330ed718b97eafba4a8ab69962fee5
MD5 6ff855ad9e0cdff510b386ea1d84afb8
BLAKE2b-256 a8479158b0c8bbc747419be1a2c911f738a47ad15e25a2d20dd50c91b647fe8f

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