Skip to content

Commit

Permalink
Update branch filter in GitHub Actions workflow and add capture devic…
Browse files Browse the repository at this point in the history
…e listing
  • Loading branch information
tphakala committed Mar 4, 2024
1 parent cea9724 commit b11d792
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Deploy Image to GHCR
on:
push:
branches:
- main
- dev
workflow_dispatch:

jobs:
Expand Down
19 changes: 19 additions & 0 deletions internal/myaudio/capture.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,25 @@ func CaptureAudio(settings *conf.Settings, wg *sync.WaitGroup, quitChan chan str
deviceConfig.SampleRate = conf.SampleRate
deviceConfig.Alsa.NoMMap = 1

var infos []malgo.DeviceInfo

// Get list of capture devices
infos, err = malgoCtx.Devices(malgo.Capture)
if err != nil {
fmt.Println(err)
os.Exit(1)
}

fmt.Println("Capture Devices")
for i, info := range infos {
e := "ok"
_, err := malgoCtx.DeviceInfo(malgo.Capture, info.ID, malgo.Shared)
if err != nil {
e = err.Error()
}
fmt.Printf(" %d: %s, [%s]\n", i, info.Name(), e)
}

// Write to ringbuffer when audio data is received
// BufferMonitor() will poll this buffer and read data from it
onReceiveFrames := func(pSample2, pSamples []byte, framecount uint32) {
Expand Down

0 comments on commit b11d792

Please sign in to comment.