mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 02:24:16 +00:00
- Add WebSocket-based sync room for real-time music playback sync. - Expand music exploration search to include albums and artists. - Adjust track and release data fetching and deletion on server. - Enhance DASH segmentation job with codec overrides and MPD updates. - Update music service configuration for websockets and middlewares. - Make minor UI adjustments to the search component.
34 lines
697 B
JavaScript
34 lines
697 B
JavaScript
import path from "node:path"
|
|
import SegmentedAudioMPDJob from "@shared-classes/SegmentedAudioMPDJob"
|
|
|
|
export default async ({ filePath, workPath, onProgress }) => {
|
|
return new Promise((resolve) => {
|
|
const outputDir = path.resolve(workPath, "a-dash")
|
|
|
|
const job = new SegmentedAudioMPDJob({
|
|
input: filePath,
|
|
outputDir: outputDir,
|
|
|
|
// set to default as raw flac
|
|
audioCodec: "copy",
|
|
audioBitrate: "default",
|
|
audioSampleRate: "default",
|
|
})
|
|
|
|
job.on("end", (data) => {
|
|
resolve(data)
|
|
})
|
|
|
|
job.on("progress", (progress) => {
|
|
if (typeof onProgress === "function") {
|
|
onProgress({
|
|
percent: progress,
|
|
state: "transmuxing",
|
|
})
|
|
}
|
|
})
|
|
|
|
job.run()
|
|
})
|
|
}
|