https://github.com/tez3998/loopback-capture-sample
Sample code which records system (speaker) sounds (what you hear) in Python.
https://github.com/tez3998/loopback-capture-sample
audio coreaudio pulseaudio python sound wasapi
Last synced: about 2 months ago
JSON representation
Sample code which records system (speaker) sounds (what you hear) in Python.
- Host: GitHub
- URL: https://github.com/tez3998/loopback-capture-sample
- Owner: tez3998
- Created: 2022-04-20T02:22:16.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-05-03T21:28:42.000Z (about 2 years ago)
- Last Synced: 2025-04-03T06:40:15.008Z (2 months ago)
- Topics: audio, coreaudio, pulseaudio, python, sound, wasapi
- Language: Python
- Homepage:
- Size: 15.6 KB
- Stars: 58
- Watchers: 1
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# loopback-capture-sample
Sample code which records system sounds (what you hear) in Python.# Demo
[](https://www.youtube.com/watch?v=7xQAhQWhLHs)# Environments
This worked on Windows 10/11 and Ubuntu 18.04.# Installation
1. Clone this repository
2. Go to the the directory you have just cloned
3. On Linux, you need to install libsndfile using your distribution’s package manager like apt in order to use SoundFile library
4. Run the following command (On Windows, I recommnend using [the current master branch of SoundCard](https://github.com/bastibe/SoundCard) because the released SoundCard has a bug related to Windows. Check [this issue I opend](https://github.com/bastibe/SoundCard/issues/166) for more infomation.)
```bash
pip install -r requirements.txt
```# Usage
1. Before running the program, start outputting sound from the device`s speaker or headphones so that the program can record that sound.
2. Run the program as below.
```bash
python capture.py
```3. After seconds, the program produces an audio file named out.wav.
4. Check if the program could record system sounds by playing out.wav.