# PyAlsaAudio
For documentation, see http://larsimmisch.github.io/pyalsaaudio/
> Author: Casper Wilstrup (cwi@aves.dk)
> Maintainer: Lars Immisch (lars@ibp.de)
This package contains wrappers for accessing the
[ALSA](http://www.alsa-project.org/) API from Python. It
is currently fairly complete for PCM devices, and has some support for mixers.
If you find bugs in the wrappers please open an issue in the issue tracker.
Please don't send bug reports regarding ALSA specifically. There are several
bugs in the ALSA API, and those should be reported to the ALSA team - not
me.
This software is licensed under the PSF license - the same one used
by the majority of the python distribution. Basically you can use it
for anything you wish (even commercial purposes). There is no warranty
whatsoever.
# Installation
## PyPI
To install pyalsaaudio via `pip` (or `easy_install`):
```
$ pip install pyalsaaudio
```
## Manual installation
*Note:* the wrappers need a kernel with ALSA support, and the
ALSA library and headers. The installation of these varies from distribution
to distribution.
On Debian or Ubuntu, make sure to install `libasound2-dev`. On Arch,
install `alsa-lib`. When in doubt, search your distribution for a
package that contains `libasound.so` and `asoundlib.h`.
First, get the sources and change to the source directory:
```
$ git clone https://github.com/larsimmisch/pyalsaaudio.git
$ cd pyalsaaudio
```
Then, build:
```
$ python setup.py build
```
And install:
```
$ sudo python setup.py install
```
# Using the API
The API documentation is included in the doc subdirectory of the source
distribution; it is also online on [http://larsimmisch.github.io/pyalsaaudio/](http://larsimmisch.github.io/pyalsaaudio/).
There are some example programs included with the source:
* [playwav.py](https://github.com/larsimmisch/pyalsaaudio/blob/master/playwav.py) plays back a wav file
* [playbacktest.py](https://github.com/larsimmisch/pyalsaaudio/blob/master/playbacktest.py) plays back raw sound data read from stdin
* [recordtest.py](https://github.com/larsimmisch/pyalsaaudio/blob/master/recordtest.py) captures sound from the microphone and writes
it raw to stdout.
* [mixertest.py](https://github.com/larsimmisch/pyalsaaudio/blob/master/mixertest.py) can be used to manipulate the mixers.
python封装的ALSA库源码及示例
需积分: 0 58 浏览量
更新于2024-09-17
收藏 41KB ZIP 举报
python封装的ALSA库源码及示例。
宇宙研究小组
- 粉丝: 472
- 资源: 15
最新资源
- 番茄助手:vs2013-2022
- JSP在服装零售中的应用:销售管理系统设计与实现
- 手机和刀具检测16-YOLO(v5至v11)、COCO、CreateML、Paligemma、TFRecord、VOC数据集合集.rar
- 网上花店:电子商务平台的设计与实现
- 自动控制原理-控制系统的数学模型实验
- 轨迹跟踪,考虑侧倾和曲率变化,同时修正侧偏刚度 simulink carsim联合仿真
- 高校勤工助学管理:系统设计与用户体验优化
- 手检测15-YOLO(v5至v11)、COCO、CreateML、Paligemma、TFRecord、VOC数据集合集.rar
- DEV-CPP-RED-PANDA
- 高通410随身WiFi ufi003 Debian固件
- abaqus齿轮动态分析,能够计算出mise应力等力学内容
- “互联网+”创新创业大赛创新奶茶店策划书.docx
- 《模拟电子技术》期末试卷.doc
- 电气控制及PLC试题库和答案复习提纲.doc
- 华南师范大学计算机网络试卷.doc
- 模拟电子技术基础期末试题.doc