Skip to content

Commit

Permalink
Fix typo, offer second option to install pyaudio for Mac ARM users
Browse files Browse the repository at this point in the history
  • Loading branch information
wiccy46 committed Dec 20, 2022
1 parent 14a9100 commit 1f202fb
Showing 1 changed file with 25 additions and 12 deletions.
37 changes: 25 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ At this time pya is more suitable for offline rendering than realtime.

## Installation

`pya` requires `portaudio` to play and record audio.
`pya` requires `portaudio` and its Python wrapper `PyAudio` to play and record audio.

### Using Conda

Expand All @@ -66,22 +66,35 @@ Disclaimer: Python 3.10+ requires PyAudio 0.2.12 which is not available on Conda
brew install portaudio
```

For Apple ARM Chip, do the following instead: [Installation on ARM chip](https://stackoverflow.com/a/73166852/4930109)
- `brew install portaudio`
- `brew --prefix poraudio`
- Create .pydistutils.cfg in your home directory, `~/.pydistutils.cfg`, add:
Then

```
[build_ext]
include_dirs=<PATH FROM STEP 3>/include/
library_dirs=<PATH FROM STEP 3>/lib/
pip install pya
```

Then use pip:
For Apple ARM Chip, if you failed to install the PyAudio dependency, you can follow this guide: [Installation on ARM chip](https://stackoverflow.com/a/73166852/4930109)
- Option 1: Create .pydistutils.cfg in your home directory, `~/.pydistutils.cfg`, add:

```
echo "[build_ext]
include_dirs=$(brew --prefix portaudio)/include/
library_dirs=$(brew --prefix portaudio)/lib/" > ~/.pydistutils.cfg
```
Use pip:

```
pip install pya
```

You can remove the `.pydistutils.cfg` file after installation.

- Option 2: Use `CFLAGS`:

```
CFLAGS="-I/opt/homebrew/include -L/opt/homebrew/lib" pip install pya
```


```
pip install pya
```

### Using PIP (Linux)

Expand Down

0 comments on commit 1f202fb

Please sign in to comment.