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.1.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

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

py_p_audio-0.1.1-cp311-cp311-win_amd64.whl (207.3 kB view details)

Uploaded CPython 3.11Windows x86-64

File details

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

File metadata

  • Download URL: py_p_audio-0.1.1.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • 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.1.tar.gz
Algorithm Hash digest
SHA256 331cd85ff965fb47d017037f3cc981c4fd98626650a62e39f96b67cb37f11ea4
MD5 76acb469272fb33bbf30a0158d99ec1a
BLAKE2b-256 18015d8e36ee69c74902553e6dab4263b3d7421db0be753de4c2d56823d33abb

See more details on using hashes here.

File details

Details for the file py_p_audio-0.1.1-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: py_p_audio-0.1.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 207.3 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for py_p_audio-0.1.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 c37c7b3c9084c45ccb2c291165313c9a084f2c6588bba54981971f39dd82db4f
MD5 fbadeba0feca9c153823c158352eca01
BLAKE2b-256 29a15e9c90b33a7d4a9bf1f8b34c06a7ce20999b947ad1bf253822da03b61f44

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