Skip to content

Commit

Permalink
fix(renderer-app): audio playback device test failed on windows system (
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackHole1 authored Dec 8, 2021
1 parent 358bd71 commit 1a2d13f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions desktop/main-app/src/utils/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ const isProduction = process.env.NODE_ENV === "production";
const isDebug = process.env.FLAT_DEBUG === "debug";

const assetsPath = isProduction
? `file://${path.resolve(__dirname, "..", "static", "render", "static", "assets")}`
: `file://${path.resolve(__dirname, "..", "..", "..", "renderer-app", "src", "assets")}`;
? path.resolve(__dirname, "..", "static", "render", "static", "assets")
: path.resolve(__dirname, "..", "..", "..", "renderer-app", "src", "assets");

const startURL = isProduction
? `file://${path.resolve(__dirname, "..", "static", "render", "index.html")}`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { runtime } from "../../../utils/runtime";
import { routeConfig } from "../../../route-config";
import { DeviceCheckResults } from "../utils";
import { useTranslation } from "react-i18next";
import path from "path";

export const SpeakerCheckPage = (): React.ReactElement => {
const { t } = useTranslation();
Expand Down Expand Up @@ -53,7 +54,11 @@ export const SpeakerCheckPage = (): React.ReactElement => {
if (currentDeviceID && isPlaying) {
rtcEngine.setAudioPlaybackDevice(currentDeviceID);
rtcEngine.startAudioPlaybackDeviceTest(
`${runtime.assetsPath}/media/Goldberg Variations, BWV 988 - 05 - Variatio 4 a 1 Clav.mp3`,
path.join(
runtime.assetsPath,
"media",
"Goldberg Variations, BWV 988 - 05 - Variatio 4 a 1 Clav.mp3",
),
);
}

Expand Down

0 comments on commit 1a2d13f

Please sign in to comment.