Skip to main content

PortAudio fork with WASAPI loopback support

Project description

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.

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

PyAudioWPatch-0.2.12.7-cp313-cp313-win_amd64.whl (87.2 kB view details)

Uploaded CPython 3.13Windows x86-64

PyAudioWPatch-0.2.12.7-cp313-cp313-win32.whl (85.3 kB view details)

Uploaded CPython 3.13Windows x86

PyAudioWPatch-0.2.12.7-cp312-cp312-win_amd64.whl (87.3 kB view details)

Uploaded CPython 3.12Windows x86-64

PyAudioWPatch-0.2.12.7-cp312-cp312-win32.whl (85.3 kB view details)

Uploaded CPython 3.12Windows x86

PyAudioWPatch-0.2.12.7-cp311-cp311-win_amd64.whl (87.0 kB view details)

Uploaded CPython 3.11Windows x86-64

PyAudioWPatch-0.2.12.7-cp311-cp311-win32.whl (85.2 kB view details)

Uploaded CPython 3.11Windows x86

PyAudioWPatch-0.2.12.7-cp310-cp310-win_amd64.whl (87.0 kB view details)

Uploaded CPython 3.10Windows x86-64

PyAudioWPatch-0.2.12.7-cp310-cp310-win32.whl (85.2 kB view details)

Uploaded CPython 3.10Windows x86

PyAudioWPatch-0.2.12.7-cp39-cp39-win_amd64.whl (87.0 kB view details)

Uploaded CPython 3.9Windows x86-64

PyAudioWPatch-0.2.12.7-cp39-cp39-win32.whl (85.2 kB view details)

Uploaded CPython 3.9Windows x86

PyAudioWPatch-0.2.12.7-cp38-cp38-win_amd64.whl (87.0 kB view details)

Uploaded CPython 3.8Windows x86-64

PyAudioWPatch-0.2.12.7-cp38-cp38-win32.whl (85.1 kB view details)

Uploaded CPython 3.8Windows x86

PyAudioWPatch-0.2.12.7-cp37-cp37m-win_amd64.whl (86.9 kB view details)

Uploaded CPython 3.7mWindows x86-64

PyAudioWPatch-0.2.12.7-cp37-cp37m-win32.whl (85.1 kB view details)

Uploaded CPython 3.7mWindows x86

File details

Details for the file PyAudioWPatch-0.2.12.7-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for PyAudioWPatch-0.2.12.7-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 050e2859e6131012e70df780412428cc6d649dcd7a3082a0a45fff369b59cdc8
MD5 19283c7799f80d4d770a40febaaf2cc4
BLAKE2b-256 f1c0920e28a5ab91c839bd9a82238035ac5a5fa52c3fb2e683d42fa454b6582c

See more details on using hashes here.

Provenance

The following attestation bundles were made for PyAudioWPatch-0.2.12.7-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.7-cp313-cp313-win32.whl.

File metadata

File hashes

Hashes for PyAudioWPatch-0.2.12.7-cp313-cp313-win32.whl
Algorithm Hash digest
SHA256 09c492ec2e63e4fff0a50fd4228b910f4621df3c54af648a0b1d5764b49b0130
MD5 d33d60f0a643cdf4b2e49228e476a5e1
BLAKE2b-256 6c7a9b9760990d9b6ed59fbd6fa28c1c148803248c8d6873fa0d1747ab56d7cc

See more details on using hashes here.

Provenance

The following attestation bundles were made for PyAudioWPatch-0.2.12.7-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.7-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for PyAudioWPatch-0.2.12.7-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 5cc251aa938bf18df42136e8cc7a9c824f41c96a93be0c184ed0a44ff417a965
MD5 addd61e947ff03bdac02fa08633130b3
BLAKE2b-256 f9ffc91c3b79f664433675d26355da899a6ebc6ec8dce1013aae54009bda7100

See more details on using hashes here.

Provenance

The following attestation bundles were made for PyAudioWPatch-0.2.12.7-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.7-cp312-cp312-win32.whl.

File metadata

File hashes

Hashes for PyAudioWPatch-0.2.12.7-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 6a0e5658b265b5505bc5cec1d58ff59129270630dffecbe3975067d1b4b4afaa
MD5 d5b6162cca3d65d1bef372951d2af3b6
BLAKE2b-256 0e8d784c19759109040f8c560df1a2a7d1ecb6b27b5173f298f2fc9fe8b5266d

See more details on using hashes here.

Provenance

The following attestation bundles were made for PyAudioWPatch-0.2.12.7-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.7-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for PyAudioWPatch-0.2.12.7-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 57a33f6549db2a3161c155526eccc30ca82d4188f9277dfcbb15055c9a5a53e0
MD5 cbeeabc381946ecdc000086ea192429f
BLAKE2b-256 5eb6e672b5dcf227895c6fbbad265c82214325819ecb419a89b1955a690bc79e

See more details on using hashes here.

Provenance

The following attestation bundles were made for PyAudioWPatch-0.2.12.7-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.7-cp311-cp311-win32.whl.

File metadata

File hashes

Hashes for PyAudioWPatch-0.2.12.7-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 aab05690a9d9380831ca82e4bf18ee8c3da7401f406f7594f576bdfd298897fb
MD5 dd900069cfb4790fd267b226c93a58a1
BLAKE2b-256 1bcb5acad3464caff0589f607ac9d6ed5385a9e6540548f21c7aee313687a1cd

See more details on using hashes here.

Provenance

The following attestation bundles were made for PyAudioWPatch-0.2.12.7-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.7-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for PyAudioWPatch-0.2.12.7-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 a6fed36cc0422863811ba41dad644deed9165cc29e18a069aa474ab95d8f10ab
MD5 b90a7cc13424ab55c701f7533feb194f
BLAKE2b-256 e90854924740f0f51304e3618d5a75c9093cb9f17471ef1453fdd7af40d0ed77

See more details on using hashes here.

Provenance

The following attestation bundles were made for PyAudioWPatch-0.2.12.7-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.7-cp310-cp310-win32.whl.

File metadata

File hashes

Hashes for PyAudioWPatch-0.2.12.7-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 5b7f43c49e701b43d4b9e0ac392bcc5b1a7688397ca97adb3412870afbe9b960
MD5 118aa85a3ddc8da35a03e5d172e465bc
BLAKE2b-256 2127deaf5a75e37e9bffccc5ef89a902130f4e28d85a5434af0d788237a58912

See more details on using hashes here.

Provenance

The following attestation bundles were made for PyAudioWPatch-0.2.12.7-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.7-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for PyAudioWPatch-0.2.12.7-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 77a960022a7f03921b26c36ab32073dbda8ccb7a97a899bc48586a264165fa1b
MD5 1224a8cea93efe0a6e7dc32becb84968
BLAKE2b-256 fdd4c27c00341185ba5cf33dbdf7a66438caa003968920de971d51507d9f445c

See more details on using hashes here.

Provenance

The following attestation bundles were made for PyAudioWPatch-0.2.12.7-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.7-cp39-cp39-win32.whl.

File metadata

File hashes

Hashes for PyAudioWPatch-0.2.12.7-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 b939e0e84cfe54bc9eff423e6781a0e00a43e645394d5885185a08490672a5b8
MD5 dd9142fe9e7e2b49571c7cde3c5bd263
BLAKE2b-256 f4b43a0fbb99a119b20b1daeb45632ca89df5bb63214fe543215b6a9457a211c

See more details on using hashes here.

Provenance

The following attestation bundles were made for PyAudioWPatch-0.2.12.7-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.7-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for PyAudioWPatch-0.2.12.7-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 b7f3c787058cc2c058930056ed9d13e46293a48599739b7c51b440d7be24073c
MD5 02fceda46b7b5aac060b6cf388fabcdb
BLAKE2b-256 fa19fc00cea35ddcc95a7f898708b9e496fc0f74d74907afd0ee9633847c9e1c

See more details on using hashes here.

Provenance

The following attestation bundles were made for PyAudioWPatch-0.2.12.7-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.7-cp38-cp38-win32.whl.

File metadata

File hashes

Hashes for PyAudioWPatch-0.2.12.7-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 d51bf185a0ca56030ae8d9b43f0589555a146979ce876416733d703d457c3a51
MD5 7585156def206b1ea4dc2b271b84e3e0
BLAKE2b-256 05aadbad17eb7062942272a88667ae7218a80c805857fda42b8b5ef99ffcaa3f

See more details on using hashes here.

Provenance

The following attestation bundles were made for PyAudioWPatch-0.2.12.7-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.

File details

Details for the file PyAudioWPatch-0.2.12.7-cp37-cp37m-win_amd64.whl.

File metadata

File hashes

Hashes for PyAudioWPatch-0.2.12.7-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 664a7b6895a3f0cd76c607b51919e7e9a925b4dfd82dcb60c4f3bbd9b61300c4
MD5 d82446cd7770e8ef69bd20e4c993e07e
BLAKE2b-256 4ee5c4a31f25bc2824d2e52b28ae6163998bbe626f6588887f2380ecdb9de416

See more details on using hashes here.

Provenance

The following attestation bundles were made for PyAudioWPatch-0.2.12.7-cp37-cp37m-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.7-cp37-cp37m-win32.whl.

File metadata

File hashes

Hashes for PyAudioWPatch-0.2.12.7-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 d8f6e47c13d0aff75fc9daa3f348294ce66206fe76238f86915f3f9ccddcdc14
MD5 f2e9d138246f0a969b8b6cb8fb6f1e72
BLAKE2b-256 8935c5119ce3fc61c5562c7a18ecb95e0a7c6e116e7d3550844ff7544db02fe4

See more details on using hashes here.

Provenance

The following attestation bundles were made for PyAudioWPatch-0.2.12.7-cp37-cp37m-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 Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page