-
Notifications
You must be signed in to change notification settings - Fork 13
/
config.go
41 lines (34 loc) · 829 Bytes
/
config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Global audio related configuration options.
package audio
type AudioConfig struct {
// The bit depth of the output stream.
// Most sinks support both 8 and 16 bit. Default: 16.
BitDepth int
// The sample rate of the output stream.
// Default: 44100.
SampleRate int
// Default: true
Stereo bool
// The number of times per second the Synth should
// handle events of its event queue.
HandleEventsPerSecond int
MidiEventInputBufferSize int
Debug bool
}
func NewAudioConfig() *AudioConfig {
return &AudioConfig{
BitDepth: 16,
SampleRate: 44100,
Stereo: true,
// The step size
HandleEventsPerSecond: 100,
MidiEventInputBufferSize: 128,
Debug: false,
}
}
func (c *AudioConfig) GetNumberOfChannels() int {
if c.Stereo {
return 2
}
return 1
}