Skip to main content
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}.
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

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.

Metadata

Release files for PyAudioWPatch 0.2.12.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for PyAudioWPatch 0.2.12.7
File Actions
PyAudioWPatch-0.2.12.7-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for PyAudioWPatch-0.2.12.7-cp313-cp313-win_amd64.whl
PyAudioWPatch-0.2.12.7-cp313-cp313-win32.whl CPython 3.13 CPython 3.13 Windows x86-32 Details for PyAudioWPatch-0.2.12.7-cp313-cp313-win32.whl
PyAudioWPatch-0.2.12.7-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for PyAudioWPatch-0.2.12.7-cp312-cp312-win_amd64.whl
PyAudioWPatch-0.2.12.7-cp312-cp312-win32.whl CPython 3.12 CPython 3.12 Windows x86-32 Details for PyAudioWPatch-0.2.12.7-cp312-cp312-win32.whl
PyAudioWPatch-0.2.12.7-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for PyAudioWPatch-0.2.12.7-cp311-cp311-win_amd64.whl
PyAudioWPatch-0.2.12.7-cp311-cp311-win32.whl CPython 3.11 CPython 3.11 Windows x86-32 Details for PyAudioWPatch-0.2.12.7-cp311-cp311-win32.whl
PyAudioWPatch-0.2.12.7-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details for PyAudioWPatch-0.2.12.7-cp310-cp310-win_amd64.whl
PyAudioWPatch-0.2.12.7-cp310-cp310-win32.whl CPython 3.10 CPython 3.10 Windows x86-32 Details for PyAudioWPatch-0.2.12.7-cp310-cp310-win32.whl
PyAudioWPatch-0.2.12.7-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details for PyAudioWPatch-0.2.12.7-cp39-cp39-win_amd64.whl
PyAudioWPatch-0.2.12.7-cp39-cp39-win32.whl CPython 3.9 CPython 3.9 Windows x86-32 Details for PyAudioWPatch-0.2.12.7-cp39-cp39-win32.whl
PyAudioWPatch-0.2.12.7-cp38-cp38-win_amd64.whl CPython 3.8 CPython 3.8 Windows x86-64 Details for PyAudioWPatch-0.2.12.7-cp38-cp38-win_amd64.whl
PyAudioWPatch-0.2.12.7-cp38-cp38-win32.whl CPython 3.8 CPython 3.8 Windows x86-32 Details for PyAudioWPatch-0.2.12.7-cp38-cp38-win32.whl
PyAudioWPatch-0.2.12.7-cp37-cp37m-win_amd64.whl CPython 3.7 CPython 3.7 pymalloc Windows x86-64 Details for PyAudioWPatch-0.2.12.7-cp37-cp37m-win_amd64.whl
PyAudioWPatch-0.2.12.7-cp37-cp37m-win32.whl CPython 3.7 CPython 3.7 pymalloc Windows x86-32 Details for PyAudioWPatch-0.2.12.7-cp37-cp37m-win32.whl

Total release size: 1.2 MB

Release files / PyAudioWPatch-0.2.12.7-cp313-cp313-win_amd64.whl

Download URL PyAudioWPatch-0.2.12.7-cp313-cp313-win_amd64.whl
Size 87.2 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
050e2859e6131012e70df780412428cc6d649dcd7a3082a0a45fff369b59cdc8
BLAKE2b-256 checksum
How to use checksums
f1c0920e28a5ab91c839bd9a82238035ac5a5fa52c3fb2e683d42fa454b6582c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 27, 2025.

Transparency log

Release files / PyAudioWPatch-0.2.12.7-cp313-cp313-win32.whl

Download URL PyAudioWPatch-0.2.12.7-cp313-cp313-win32.whl
Size 85.3 kB
Tags CPython 3.13 Windows x86-32
SHA-256 checksum
How to use checksums
09c492ec2e63e4fff0a50fd4228b910f4621df3c54af648a0b1d5764b49b0130
BLAKE2b-256 checksum
How to use checksums
6c7a9b9760990d9b6ed59fbd6fa28c1c148803248c8d6873fa0d1747ab56d7cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 27, 2025.

Transparency log

Release files / PyAudioWPatch-0.2.12.7-cp312-cp312-win_amd64.whl

Download URL PyAudioWPatch-0.2.12.7-cp312-cp312-win_amd64.whl
Size 87.3 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
5cc251aa938bf18df42136e8cc7a9c824f41c96a93be0c184ed0a44ff417a965
BLAKE2b-256 checksum
How to use checksums
f9ffc91c3b79f664433675d26355da899a6ebc6ec8dce1013aae54009bda7100
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 27, 2025.

Transparency log

Release files / PyAudioWPatch-0.2.12.7-cp312-cp312-win32.whl

Download URL PyAudioWPatch-0.2.12.7-cp312-cp312-win32.whl
Size 85.3 kB
Tags CPython 3.12 Windows x86-32
SHA-256 checksum
How to use checksums
6a0e5658b265b5505bc5cec1d58ff59129270630dffecbe3975067d1b4b4afaa
BLAKE2b-256 checksum
How to use checksums
0e8d784c19759109040f8c560df1a2a7d1ecb6b27b5173f298f2fc9fe8b5266d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 27, 2025.

Transparency log

Release files / PyAudioWPatch-0.2.12.7-cp311-cp311-win_amd64.whl

Download URL PyAudioWPatch-0.2.12.7-cp311-cp311-win_amd64.whl
Size 87.0 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
57a33f6549db2a3161c155526eccc30ca82d4188f9277dfcbb15055c9a5a53e0
BLAKE2b-256 checksum
How to use checksums
5eb6e672b5dcf227895c6fbbad265c82214325819ecb419a89b1955a690bc79e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 27, 2025.

Transparency log

Release files / PyAudioWPatch-0.2.12.7-cp311-cp311-win32.whl

Download URL PyAudioWPatch-0.2.12.7-cp311-cp311-win32.whl
Size 85.2 kB
Tags CPython 3.11 Windows x86-32
SHA-256 checksum
How to use checksums
aab05690a9d9380831ca82e4bf18ee8c3da7401f406f7594f576bdfd298897fb
BLAKE2b-256 checksum
How to use checksums
1bcb5acad3464caff0589f607ac9d6ed5385a9e6540548f21c7aee313687a1cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 27, 2025.

Transparency log

Release files / PyAudioWPatch-0.2.12.7-cp310-cp310-win_amd64.whl

Download URL PyAudioWPatch-0.2.12.7-cp310-cp310-win_amd64.whl
Size 87.0 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
a6fed36cc0422863811ba41dad644deed9165cc29e18a069aa474ab95d8f10ab
BLAKE2b-256 checksum
How to use checksums
e90854924740f0f51304e3618d5a75c9093cb9f17471ef1453fdd7af40d0ed77
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 27, 2025.

Transparency log

Release files / PyAudioWPatch-0.2.12.7-cp310-cp310-win32.whl

Download URL PyAudioWPatch-0.2.12.7-cp310-cp310-win32.whl
Size 85.2 kB
Tags CPython 3.10 Windows x86-32
SHA-256 checksum
How to use checksums
5b7f43c49e701b43d4b9e0ac392bcc5b1a7688397ca97adb3412870afbe9b960
BLAKE2b-256 checksum
How to use checksums
2127deaf5a75e37e9bffccc5ef89a902130f4e28d85a5434af0d788237a58912
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 27, 2025.

Transparency log

Release files / PyAudioWPatch-0.2.12.7-cp39-cp39-win_amd64.whl

Download URL PyAudioWPatch-0.2.12.7-cp39-cp39-win_amd64.whl
Size 87.0 kB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
77a960022a7f03921b26c36ab32073dbda8ccb7a97a899bc48586a264165fa1b
BLAKE2b-256 checksum
How to use checksums
fdd4c27c00341185ba5cf33dbdf7a66438caa003968920de971d51507d9f445c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 27, 2025.

Transparency log

Release files / PyAudioWPatch-0.2.12.7-cp39-cp39-win32.whl

Download URL PyAudioWPatch-0.2.12.7-cp39-cp39-win32.whl
Size 85.2 kB
Tags CPython 3.9 Windows x86-32
SHA-256 checksum
How to use checksums
b939e0e84cfe54bc9eff423e6781a0e00a43e645394d5885185a08490672a5b8
BLAKE2b-256 checksum
How to use checksums
f4b43a0fbb99a119b20b1daeb45632ca89df5bb63214fe543215b6a9457a211c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 27, 2025.

Transparency log

Release files / PyAudioWPatch-0.2.12.7-cp38-cp38-win_amd64.whl

Download URL PyAudioWPatch-0.2.12.7-cp38-cp38-win_amd64.whl
Size 87.0 kB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
b7f3c787058cc2c058930056ed9d13e46293a48599739b7c51b440d7be24073c
BLAKE2b-256 checksum
How to use checksums
fa19fc00cea35ddcc95a7f898708b9e496fc0f74d74907afd0ee9633847c9e1c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 27, 2025.

Transparency log

Release files / PyAudioWPatch-0.2.12.7-cp38-cp38-win32.whl

Download URL PyAudioWPatch-0.2.12.7-cp38-cp38-win32.whl
Size 85.1 kB
Tags CPython 3.8 Windows x86-32
SHA-256 checksum
How to use checksums
d51bf185a0ca56030ae8d9b43f0589555a146979ce876416733d703d457c3a51
BLAKE2b-256 checksum
How to use checksums
05aadbad17eb7062942272a88667ae7218a80c805857fda42b8b5ef99ffcaa3f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 27, 2025.

Transparency log

Release files / PyAudioWPatch-0.2.12.7-cp37-cp37m-win_amd64.whl

Download URL PyAudioWPatch-0.2.12.7-cp37-cp37m-win_amd64.whl
Size 86.9 kB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
664a7b6895a3f0cd76c607b51919e7e9a925b4dfd82dcb60c4f3bbd9b61300c4
BLAKE2b-256 checksum
How to use checksums
4ee5c4a31f25bc2824d2e52b28ae6163998bbe626f6588887f2380ecdb9de416
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 27, 2025.

Transparency log

Release files / PyAudioWPatch-0.2.12.7-cp37-cp37m-win32.whl

Download URL PyAudioWPatch-0.2.12.7-cp37-cp37m-win32.whl
Size 85.1 kB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
d8f6e47c13d0aff75fc9daa3f348294ce66206fe76238f86915f3f9ccddcdc14
BLAKE2b-256 checksum
How to use checksums
8935c5119ce3fc61c5562c7a18ecb95e0a7c6e116e7d3550844ff7544db02fe4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 27, 2025.

Transparency log

Security for PyAudioWPatch 0.2.12.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 14 files in this release have been uploaded with provenance metadata.

Select from 14 files

Attestation for PyAudioWPatch-0.2.12.7-cp313-cp313-win_amd64.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 27, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page