Skip to content

Commit

Permalink
Turn John into mono mode
Browse files Browse the repository at this point in the history
Signed-off-by: Maartje Eyskens <[email protected]>
  • Loading branch information
meyskens committed Oct 25, 2020
1 parent c79df71 commit f5d9746
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/commands/giphy/giphy.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (g *GiphyCommands) clap(s *discordgo.Session, m *discordgo.MessageCreate) {
if m.ChannelID == discordTalksVragen {
err := g.server.GetDiscordHA().SendVoiceCommand("thomasbot", discordha.VoiceCommand{
ChannelID: audioChannel,
File: "clapping2.wav",
File: "clappingmono.wav",
UserID: m.Author.ID,
})
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions pkg/mixer/encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func (is *InputStream) Read(b []int16) (n int, err error) {

// NewEncoder gives a new Encoder
func NewEncoder() *Encoder {
enc, err := opus.NewEncoder(48000, 2, opus.AppAudio)
enc, err := opus.NewEncoder(48000, 1, opus.AppAudio)
if err != nil {
panic("Failed creating encoder: " + err.Error())
}
Expand Down Expand Up @@ -133,9 +133,9 @@ func (e *Encoder) Run() {

func (e *Encoder) processQueue() {
e.queueLock.Lock()
mixedPCM := make([]int16, 48*20*2)
mixedPCM := make([]int16, 48*20*1)
for _, st := range e.inputStreams {
userPCM := make([]int16, 48*20*2)
userPCM := make([]int16, 48*20*1)
n, _ := st.Read(userPCM)
if n < 1 {
continue
Expand Down
Binary file added sounds/clappingmono.wav
Binary file not shown.

0 comments on commit f5d9746

Please sign in to comment.