Skip to content

armgit / Piik

Public Imported from GitHub
0

Free, open-source screen sharing for private live streams with friends. Watch together in a browser or self-host Piik. 免费开源的私密屏幕共享,支持游戏直播、一起看电影与自部署。

843 B
Raw Blame
import { describe, expect, it } from "vitest";

import { audioInputConstraints, displayMediaOptions } from "../src/client/media/audio-capture.ts";

describe("browser display audio capture", () => {
  it("keeps screen audio free of speech processing and prefers stereo", () => {
    const options = displayMediaOptions({ width: { ideal: 1280 } });

    expect(options).toMatchObject({
      audio: {
        echoCancellation: false,
        noiseSuppression: false,
        autoGainControl: false,
        voiceIsolation: false,
        channelCount: { ideal: 2 },
        restrictOwnAudio: true,
      },
      systemAudio: "include",
      windowAudio: "window",
    });
    expect(audioInputConstraints(true)).not.toHaveProperty("restrictOwnAudio");
    expect(audioInputConstraints(false)).not.toHaveProperty("restrictOwnAudio");
  });
});