Skip to main content

PortAudio fork with WASAPI loopback support

Project description

❤ Recall.ai - API for desktop recording

If you’re looking for a hosted desktop recording API, consider checking out Recall.ai, an API that records Zoom, Google Meet, Microsoft Teams, in-person meetings, and more.

✨ This repo is sponsored by Recall.ai ✨

PyAudio Wasapi Loopback Patch

PyAudioWPatch

This fork will allow you to use the WASAPI device as loopback using PyAudio.
So you can use speakers to record audio

Last Commit Wheels Downloads Py Version Latest release



For whom?

If you want to record sound from speakers in python, then this fork is for you. You can get recording from any device that supports WASAPI, for example, you can even record audio from Bluetooth headphones🎧

PyAudioW(indows|ASAPI)Patch come only with WMME, DirectX and WASAPI support if you need more -> create an issue

How

The Windows Audio Session API (WASAPI) allows you to use output devices (that support this API) in loopback mode. At the time of release, it was impossible to achieve this using the original version of PyAudio.

Note: Now WASAPI loopback devices are duplicated at the end of the list as virtual devices. That is, to record from speakers, you need to use not just a WASAPI device, but its loopback analogue. All loopback devices are input devices.

How to use

Read -> Install -> Enjoy!Press ⭐

Installation

pip install PyAudioWPatch

Wheels are available for Windows, Python 3.{7,8,9,10,11,12,13}.
All wheels support APIs: WMME, WASAPI, DirectX(DSound).

In code

With new features:

import pyaudiowpatch as pyaudio

with pyaudio.PyAudio() as p:
    # Open PyA manager via context manager
    with p.open(...) as stream:
        # Open audio stream via context manager
        # Do some stuff
        ...

Or in original PyAudio way:

import pyaudiowpatch as pyaudio

p = pyaudio.PyAudio()
stream = p.open(...)

# Do some stuff
...

stream.stop_stream()
stream.close()

# close PyAudio
p.terminate()

Difference with PyAudio

  • The behavior of all standard methods is unchanged
  • Added several life-improving methods
  • Fixed problem with name encoding
  • Ability to record audio from WASAPI loopback devices (see example)

More detailed

Examples:

Sources

The following were taken as a basis:

How to build manually

  • Build PortAudio (using the instructions in the README)
  • Install python
  • run in the PyAudioWPatch directory:
    python setup.py install
    
  • ???
  • Profit.

Also you can build wheels:

  • pip install cibuildwheel
  • Run in Cygwin:
    ./cygwin_cibuildwheel_build.sh
    
  • Get your wheels in the ./wheelhouse folder

Star History

Star History Chart

Origin README

PyAudio

PyAudio provides Python bindings for PortAudio v19, the cross-platform audio I/O library. With PyAudio, you can easily use Python to play and record audio on a variety of platforms, such as GNU/Linux, Microsoft Windows, and Apple macOS.

PyAudio is distributed under the MIT License.

Installation

See the INSTALLATION file in the source distribution for details. In summary, install PyAudio using pip on most platforms.

Windows

python -m pip install pyaudio

This installs the precompiled PyAudio library with PortAudio v19 19.7.0 included. The library is compiled with support for Windows MME API, DirectSound, WASAPI, and WDM-KS. It does not include support for ASIO. If you require support for APIs not included, you will need to compile PortAudio and PyAudio.

macOS

Use Homebrew to install the prerequisite portaudio library, then install PyAudio using pip:

brew install portaudio
pip install pyaudio

GNU/Linux

Use the package manager to install PyAudio. For example, on Debian-based systems:

sudo apt install python3-pyaudio

Alternatively, if the latest version of PyAudio is not available, install it using pip. Be sure to first install development libraries for portaudio19 and python3.

Building from source

See the INSTALLATION file.

Documentation & Usage Examples

License

PyAudio is distributed under the MIT License. See LICENSE.txt.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

pyaudiowpatch-0.2.12.8-cp314-cp314-win_amd64.whl (101.0 kB view details)

Uploaded CPython 3.14Windows x86-64

pyaudiowpatch-0.2.12.8-cp314-cp314-win32.whl (98.8 kB view details)

Uploaded CPython 3.14Windows x86

pyaudiowpatch-0.2.12.8-cp313-cp313-win_amd64.whl (99.3 kB view details)

Uploaded CPython 3.13Windows x86-64

pyaudiowpatch-0.2.12.8-cp313-cp313-win32.whl (96.8 kB view details)

Uploaded CPython 3.13Windows x86

pyaudiowpatch-0.2.12.8-cp312-cp312-win_amd64.whl (99.3 kB view details)

Uploaded CPython 3.12Windows x86-64

pyaudiowpatch-0.2.12.8-cp312-cp312-win32.whl (96.8 kB view details)

Uploaded CPython 3.12Windows x86

pyaudiowpatch-0.2.12.8-cp311-cp311-win_amd64.whl (99.1 kB view details)

Uploaded CPython 3.11Windows x86-64

pyaudiowpatch-0.2.12.8-cp311-cp311-win32.whl (96.6 kB view details)

Uploaded CPython 3.11Windows x86

pyaudiowpatch-0.2.12.8-cp310-cp310-win_amd64.whl (99.1 kB view details)

Uploaded CPython 3.10Windows x86-64

pyaudiowpatch-0.2.12.8-cp310-cp310-win32.whl (96.6 kB view details)

Uploaded CPython 3.10Windows x86

pyaudiowpatch-0.2.12.8-cp39-cp39-win_amd64.whl (99.1 kB view details)

Uploaded CPython 3.9Windows x86-64

pyaudiowpatch-0.2.12.8-cp39-cp39-win32.whl (96.6 kB view details)

Uploaded CPython 3.9Windows x86

pyaudiowpatch-0.2.12.8-cp38-cp38-win_amd64.whl (99.0 kB view details)

Uploaded CPython 3.8Windows x86-64

pyaudiowpatch-0.2.12.8-cp38-cp38-win32.whl (96.6 kB view details)

Uploaded CPython 3.8Windows x86

File details

Details for the file pyaudiowpatch-0.2.12.8-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for pyaudiowpatch-0.2.12.8-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 df6e26032439d87cbbeb8f433e635652a36d54cdd14aa058188e21ba5c9a7df9
MD5 7b4771704a70be13dd94310438102a6f
BLAKE2b-256 12611c9e515e45dfd86d25a1447ac7241436c8000c3ab142011c23fb1d3202ed

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyaudiowpatch-0.2.12.8-cp314-cp314-win_amd64.whl:

Publisher: release-to-pypi.yml on s0d3s/PyAudioWPatch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyaudiowpatch-0.2.12.8-cp314-cp314-win32.whl.

File metadata

File hashes

Hashes for pyaudiowpatch-0.2.12.8-cp314-cp314-win32.whl
Algorithm Hash digest
SHA256 448b83316295ab4786b1844ea296d4848c75b93ada4df6f2150715520cf985a5
MD5 d51ffa16027724b06a717979a939b021
BLAKE2b-256 8ecfa2544222ca61b89b27beed06efc7d9f865216fd31d0da677921ef9fb3b9d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyaudiowpatch-0.2.12.8-cp314-cp314-win32.whl:

Publisher: release-to-pypi.yml on s0d3s/PyAudioWPatch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyaudiowpatch-0.2.12.8-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for pyaudiowpatch-0.2.12.8-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 3339e6430836a021e1a83ddb915a42eec0a8f198693855a8f32a57b4b97e0202
MD5 849102dc57b18cd22dddb2db07dadb24
BLAKE2b-256 650faa9e6c6d331d2a027330e1275697ece6ace23c2209df8cd0f8c0e397ba1c

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyaudiowpatch-0.2.12.8-cp313-cp313-win_amd64.whl:

Publisher: release-to-pypi.yml on s0d3s/PyAudioWPatch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyaudiowpatch-0.2.12.8-cp313-cp313-win32.whl.

File metadata

File hashes

Hashes for pyaudiowpatch-0.2.12.8-cp313-cp313-win32.whl
Algorithm Hash digest
SHA256 d941c272ced5b1c6f1d054d47046ef50efcee954151c293c0102b410f549c3ab
MD5 ba95f14438e3a19fadab6132d86d6cc4
BLAKE2b-256 4bb962c83aea777521b0748f3ec6b4d0f8650af88d2a7fee03b98a6257f8ec32

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyaudiowpatch-0.2.12.8-cp313-cp313-win32.whl:

Publisher: release-to-pypi.yml on s0d3s/PyAudioWPatch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyaudiowpatch-0.2.12.8-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for pyaudiowpatch-0.2.12.8-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 fd163a6531c4e4969925e687ef1bc57fae8ecc1a95de7ba707a436622552d7fa
MD5 e0234ccab5d4cec1e7157e73bb19c91f
BLAKE2b-256 e5e1c25c239737386a3fd85354ce35a00fbe83e993a7e51d76791022850ca12c

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyaudiowpatch-0.2.12.8-cp312-cp312-win_amd64.whl:

Publisher: release-to-pypi.yml on s0d3s/PyAudioWPatch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyaudiowpatch-0.2.12.8-cp312-cp312-win32.whl.

File metadata

File hashes

Hashes for pyaudiowpatch-0.2.12.8-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 5c6f54cbee50ed3c971767cc8e85f45e94012aa3c4363b7cdd8541e9f9496d01
MD5 eeb6e755b9c5c3cb760422836b148d67
BLAKE2b-256 884eba7c938033fb25ba25f35e9f125f5c270e60c7789e65662d37424a5d9c0c

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyaudiowpatch-0.2.12.8-cp312-cp312-win32.whl:

Publisher: release-to-pypi.yml on s0d3s/PyAudioWPatch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyaudiowpatch-0.2.12.8-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for pyaudiowpatch-0.2.12.8-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 8610948499efa12b01ec861408fcc95e7bc18c1dddf0abbfed6fd2305a898f63
MD5 1804d0bb5150322c5503f83fc5d6542d
BLAKE2b-256 55df88a94ca45c8b158b52888f5010cdad2f7998d5c4a44d0794fab97937f9ec

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyaudiowpatch-0.2.12.8-cp311-cp311-win_amd64.whl:

Publisher: release-to-pypi.yml on s0d3s/PyAudioWPatch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyaudiowpatch-0.2.12.8-cp311-cp311-win32.whl.

File metadata

File hashes

Hashes for pyaudiowpatch-0.2.12.8-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 13903f6a78abfd745fbae82c1edda95119fce179c6f2fc95e7849a54d537dce1
MD5 11da645e80585e16c29eee16d65dbf45
BLAKE2b-256 f8a30bd930258c9b81f77ec52f1edfa5a8ed44c4d6079d1253c4fee5ed766863

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyaudiowpatch-0.2.12.8-cp311-cp311-win32.whl:

Publisher: release-to-pypi.yml on s0d3s/PyAudioWPatch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyaudiowpatch-0.2.12.8-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for pyaudiowpatch-0.2.12.8-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 7a2059464378213c0b83cdbea04a0ceacbdbd5ec791ffe29ed2ce490321aa604
MD5 7a60f80546aeb611a5ec54fdaea97fc5
BLAKE2b-256 bc1be913831e7d7d8b5c325b2c08f00dfe93a3d6af284af64dfdcd5637e85fad

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyaudiowpatch-0.2.12.8-cp310-cp310-win_amd64.whl:

Publisher: release-to-pypi.yml on s0d3s/PyAudioWPatch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyaudiowpatch-0.2.12.8-cp310-cp310-win32.whl.

File metadata

File hashes

Hashes for pyaudiowpatch-0.2.12.8-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 c5bffe533fdf37f36f58d8997f90247d46d42db2b1c4a970d9cc4637dacd322c
MD5 de3ecc157549bffbcad539b9ab1fc279
BLAKE2b-256 b4f61ab3beaae4641a6c21f2bbc6e5d95d7dcdc9cb253a406f23669fc66d996b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyaudiowpatch-0.2.12.8-cp310-cp310-win32.whl:

Publisher: release-to-pypi.yml on s0d3s/PyAudioWPatch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyaudiowpatch-0.2.12.8-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for pyaudiowpatch-0.2.12.8-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 19dd0727ac54c5fc2062d3073a985099348fe8c57b7f284007c50b02f8601e57
MD5 4329f8c33cbcccbc7d8168cf9aa2c479
BLAKE2b-256 0cdbae56584fc1e2d37a78ace1a9c3626dd96971ab961bcc27b4a6b3885ba29d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyaudiowpatch-0.2.12.8-cp39-cp39-win_amd64.whl:

Publisher: release-to-pypi.yml on s0d3s/PyAudioWPatch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyaudiowpatch-0.2.12.8-cp39-cp39-win32.whl.

File metadata

File hashes

Hashes for pyaudiowpatch-0.2.12.8-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 f9f7b48b3baa088e2bc1f8e4d465ce5341b62fcd7a57023427ff1d8f7b4c1269
MD5 62e5a633315b41c2740ecc4d8a86c2df
BLAKE2b-256 084e78077b169b3bafd6f4baf656f5b36c419f616f133280a38ef60091b0b866

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyaudiowpatch-0.2.12.8-cp39-cp39-win32.whl:

Publisher: release-to-pypi.yml on s0d3s/PyAudioWPatch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyaudiowpatch-0.2.12.8-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for pyaudiowpatch-0.2.12.8-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 0de232f72302c4a37162ab0c56f55616631b0490f213f7dbe651ba589d7d77a0
MD5 3b4cf0abf817f6cccae21cb7e9808bf7
BLAKE2b-256 1f7e172d828ba914d18600c5ee10a7f7a7e77f404924bc7f85f41a7b8f278462

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyaudiowpatch-0.2.12.8-cp38-cp38-win_amd64.whl:

Publisher: release-to-pypi.yml on s0d3s/PyAudioWPatch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyaudiowpatch-0.2.12.8-cp38-cp38-win32.whl.

File metadata

File hashes

Hashes for pyaudiowpatch-0.2.12.8-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 82617f01581a563ffab228bdf6b31a72949ce7673bf7d2716294da142012b645
MD5 3281b95ac7524a668debb201188ea7cf
BLAKE2b-256 3f5c46b571648ca9dea1d954a2fab888ce2b83b28e1e832e6f31e10b71e28ddf

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyaudiowpatch-0.2.12.8-cp38-cp38-win32.whl:

Publisher: release-to-pypi.yml on s0d3s/PyAudioWPatch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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