Skip to content

Commit

Permalink
CGO deps disabled by default. see README.md for instructions on enabl…
Browse files Browse the repository at this point in the history
…ing.
  • Loading branch information
noriah committed Apr 6, 2022
1 parent aee9e07 commit 6ac6e86
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 23 deletions.
30 changes: 11 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@
</p>

## it supports audio backends
- PortAudio (linux/macOS/*windblows**)
- PulseAudio (parec/FFmpeg)
- AVFoundation (macOS FFmpeg)
- ALSA (linux FFmpeg)
- AVFoundation (macOS FFmpeg)
- DirectShow (windblows FFmpeg)

*portaudio is difficult on windows. by default it is disabled on windows.
- PortAudio (linux/macOS/windblows)
- PulseAudio (parec/FFmpeg)

## it depends on

Expand All @@ -30,14 +28,14 @@
- github.com/lawl/pulseaudio
- gonum.org/v1/gonum

- c libraries (optional, disable all with `CGO_ENABLED=0`)
- fftw (fftw3) (disable with `-tags nofftw`)
- portaudio (portaudio-2.0) (disable with `-tags noportaudio`)

- binaries
- ffmpeg (required for FFmpeg backends)
- parec (required for PulseAudio backend with parec)

- c libraries (optional, requires CGO - `CGO_ENABLED=1`)
- fftw (fftw3) (enable with `-tags withfftw`)
- portaudio (portaudio-2.0) (enable with `-tags withportaudio`)

## get it

```sh
Expand All @@ -50,17 +48,11 @@ cd catnip
# build and install catnip
go install

# without cgo
CGO_ENABLED=0 go install

# without portaudio on linux/unix/macOS
go install -tags noportaudio

# with portaudio on windows
go install -tags portonwin
# with portaudio
go install -tags withportaudio

# with fftw3 on windows
go install -tags fftwonwin
# with fftw3
go install -tags withfftw
```

## run it
Expand Down
1 change: 0 additions & 1 deletion catnip.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ func catnip(cfg *config) error {
// - super smooth detail view
func newZeroConfig() config {
return config{
backend: "portaudio",
sampleRate: 44100,
sampleSize: 1024,
smoothFactor: 80.15,
Expand Down
2 changes: 1 addition & 1 deletion fft/fftw.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:build cgo && ((!windows && !nofftw) || (windows && fftwonwin))
//go:build cgo && withfftw

package fft

Expand Down
2 changes: 1 addition & 1 deletion fft/gonum.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:build !cgo || nofftw || (windows && !fftwonwin)
//go:build !cgo || !withfftw

package fft

Expand Down
2 changes: 1 addition & 1 deletion portaudio.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:build cgo && ((!windows && !noportaudio) || (windows && portonwin))
//go:build cgo && withportaudio

package main

Expand Down

0 comments on commit 6ac6e86

Please sign in to comment.