feat: Add client-side voice processing and comprehensive packet handling, leveraging a Go-native Opus library.
This commit is contained in:
@@ -9,7 +9,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func (c *Client) handlePacket(pkt *protocol.Packet) error {
|
func (c *Client) handlePacket(pkt *protocol.Packet) error {
|
||||||
log.Printf("Received Packet: ID=%d, Type=%v, Len=%d", pkt.Header.PacketID, pkt.Header.PacketType(), len(pkt.Data))
|
// log.Printf("Received Packet: ID=%d, Type=%v, Len=%d", pkt.Header.PacketID, pkt.Header.PacketType(), len(pkt.Data))
|
||||||
|
|
||||||
switch pkt.Header.PacketType() {
|
switch pkt.Header.PacketType() {
|
||||||
case protocol.PacketTypeInit1:
|
case protocol.PacketTypeInit1:
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ func (c *Client) handleVoice(pkt *protocol.Packet) {
|
|||||||
|
|
||||||
// 3. Process PCM: Reduce Volume (divide by 4)
|
// 3. Process PCM: Reduce Volume (divide by 4)
|
||||||
for i := range pcm {
|
for i := range pcm {
|
||||||
pcm[i] = pcm[i] / 4
|
pcm[i] = pcm[i] / 10
|
||||||
}
|
}
|
||||||
|
|
||||||
// 4. Get or Create Encoder
|
// 4. Get or Create Encoder
|
||||||
|
|||||||
Binary file not shown.
BIN
libiconv-2.dll
BIN
libiconv-2.dll
Binary file not shown.
BIN
libintl-8.dll
BIN
libintl-8.dll
Binary file not shown.
BIN
libogg-0.dll
BIN
libogg-0.dll
Binary file not shown.
BIN
libopus-0.dll
BIN
libopus-0.dll
Binary file not shown.
Binary file not shown.
BIN
libstdc++-6.dll
BIN
libstdc++-6.dll
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user