Skip to content

Commit

Permalink
Merge pull request #201 from oakmound/feature/v4-audio
Browse files Browse the repository at this point in the history
audio: overhaul api for v4
  • Loading branch information
200sc authored Apr 9, 2022
2 parents 625f93f + 6228748 commit 225ad13
Show file tree
Hide file tree
Showing 85 changed files with 1,372 additions and 3,203 deletions.
133 changes: 0 additions & 133 deletions audio/audio.go

This file was deleted.

69 changes: 0 additions & 69 deletions audio/audio_test.go

This file was deleted.

2 changes: 0 additions & 2 deletions audio/doc.go

This file was deleted.

18 changes: 10 additions & 8 deletions audio/pcm/driver.go → audio/driver.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package pcm
package audio

// A Driver defines the underlying interface that should be used for initializing PCM audio writers
// by this package.
Expand All @@ -10,14 +10,16 @@ const (
DriverDefault Driver = iota
DriverPulse
DriverDirectSound
DriverALSA
)

var driverNames = map[Driver]string{
DriverPulse: "pulseaudio",
DriverDirectSound: "directsound",
DriverDefault: "default",
DriverALSA: "alsa",
}

func (d Driver) String() string {
switch d {
case DriverPulse:
return "pulseaudio"
case DriverDirectSound:
return "directsound"
}
return ""
return driverNames[d]
}
17 changes: 17 additions & 0 deletions audio/driver_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package audio

import "testing"

func TestDriver_String(t *testing.T) {
drivers := []Driver{
DriverDefault,
DriverDirectSound,
DriverPulse,
DriverALSA,
}
for _, d := range drivers {
if d.String() == "" {
t.Errorf("driver %d had no defined string", d)
}
}
}
67 changes: 0 additions & 67 deletions audio/ears.go

This file was deleted.

15 changes: 0 additions & 15 deletions audio/error_test.go

This file was deleted.

Loading

0 comments on commit 225ad13

Please sign in to comment.