mirror of
https://github.com/J3vb/OwnCord.git
synced 2026-09-03 03:50:00 +03:00
fix: resolve LiveKit voice issues — duplicate audio, tunnel effect with 5+ users
- Detach existing audio elements before attaching to prevent double playback on reconnects - Remove webAudioMix to eliminate Web Audio overhead compounding with multiple participants - Use participant.setVolume() for full 0-200% per-user volume range - Add pli_throttle and active_loopback_prevention to LiveKit server config - Bump version to 1.3.0
This commit is contained in:
@@ -147,7 +147,7 @@ OwnCord/
|
||||
|
||||
```bash
|
||||
cd Server
|
||||
go build -o chatserver.exe -ldflags "-s -w -X main.version=1.0.0" .
|
||||
go build -o chatserver.exe -ldflags "-s -w -X main.version=1.3.0" .
|
||||
go test ./... # all tests
|
||||
go test ./... -cover # with coverage
|
||||
```
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "owncord-client",
|
||||
"private": true,
|
||||
"version": "1.2.0",
|
||||
"version": "1.3.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "owncord-client"
|
||||
version = "1.2.0"
|
||||
version = "1.3.0"
|
||||
edition = "2021"
|
||||
description = "OwnCord Desktop Client"
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"productName": "OwnCord",
|
||||
"version": "1.2.0",
|
||||
"version": "1.3.0",
|
||||
"identifier": "com.owncord.client",
|
||||
"build": {
|
||||
"frontendDist": "../dist",
|
||||
|
||||
@@ -88,7 +88,6 @@ export class LiveKitSession {
|
||||
const newRoom = new Room({
|
||||
adaptiveStream: true,
|
||||
dynacast: true,
|
||||
webAudioMix: true,
|
||||
audioCaptureDefaults: {
|
||||
echoCancellation: loadPref("echoCancellation", true),
|
||||
noiseSuppression: loadPref("noiseSuppression", true),
|
||||
@@ -111,13 +110,14 @@ export class LiveKitSession {
|
||||
): void => {
|
||||
const userId = parseUserId(participant.identity);
|
||||
if (track.kind === Track.Kind.Audio) {
|
||||
// Attach creates an <audio> element — required for playback
|
||||
// Detach any previous <audio> elements to prevent duplicate playback
|
||||
// on fast reconnects (new subscription fires before old unsubscription)
|
||||
for (const el of track.detach()) el.remove();
|
||||
const audioEl = track.attach();
|
||||
audioEl.style.display = "none";
|
||||
document.body.appendChild(audioEl);
|
||||
// Apply saved per-user volume scaled by master output volume
|
||||
const savedVolume = userId > 0 ? getSavedUserVolume(userId) : 100;
|
||||
audioEl.volume = Math.min(savedVolume, 100) / 100;
|
||||
// Apply saved per-user volume via LiveKit's setVolume (supports 0-2.0 range)
|
||||
participant.setVolume(this.getEffectiveVolume(userId));
|
||||
const savedOutput = loadPref<string>("audioOutputDevice", "");
|
||||
if (savedOutput !== "" && typeof audioEl.setSinkId === "function") {
|
||||
audioEl.setSinkId(savedOutput).catch((err) => {
|
||||
|
||||
@@ -58,14 +58,24 @@ func (p *LiveKitProcess) generateConfig() (string, error) {
|
||||
|
||||
content := fmt.Sprintf(`# Auto-generated by OwnCord — do not edit manually.
|
||||
port: 7880
|
||||
|
||||
rtc:
|
||||
port_range_start: 50000
|
||||
port_range_end: 60000
|
||||
use_external_ip: true
|
||||
pli_throttle:
|
||||
low_quality: 500ms
|
||||
mid_quality: 1s
|
||||
high_quality: 1s
|
||||
|
||||
keys:
|
||||
"%s": "%s"
|
||||
|
||||
logging:
|
||||
level: info
|
||||
|
||||
audio:
|
||||
active_loopback_prevention: true
|
||||
`, p.cfg.LiveKitAPIKey, p.cfg.LiveKitAPISecret)
|
||||
|
||||
if err := os.MkdirAll(p.dataDir, 0o755); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user