https://github.com/mycroftai/pylisten
A simple pyaudio microphone interface
https://github.com/mycroftai/pylisten
library microphone pyaudio recording
Last synced: 11 months ago
JSON representation
A simple pyaudio microphone interface
- Host: GitHub
- URL: https://github.com/mycroftai/pylisten
- Owner: MycroftAI
- License: apache-2.0
- Created: 2018-07-27T06:50:40.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-07-27T07:10:36.000Z (almost 8 years ago)
- Last Synced: 2025-06-04T23:31:12.978Z (about 1 year ago)
- Topics: library, microphone, pyaudio, recording
- Language: Python
- Size: 5.86 KB
- Stars: 11
- Watchers: 3
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PyListen
*A simple pyaudio microphone interface*
PyListen abstracts creating an audio stream and converting
raw byte data into numpy arrays.
## Usage
```python
from pylisten import Listener, WindowListener, FeatureListener
for chunk in Listener(frames_per_buffer=512, rate=24100):
print('Current volume:', abs(chunk).mean())
for window in WindowListener(1024 * 10, 1024):
print('Volume of last 10 chunks:', abs(window).mean())
for features in FeatureListener(lambda x: [abs(x).mean()], 1024, 20):
print('Past 20 volumes:', features)
```
## Installation
```bash
pip install pylisten
```