fix: force 2 channels for ffmpeg decoding

This commit is contained in:
Stefano Brilli 2021-03-30 00:39:41 +02:00
parent 32a7d21fdf
commit b6ba2dc1fb
1 changed files with 2 additions and 2 deletions

View File

@ -83,12 +83,12 @@ export class FFMpegAudioExportService implements AudioExportService {
let result: ArrayBuffer;
if (format === `SP`) {
const outFileName = `${this.outFileNameNoExt}.raw`;
await this.ffmpegProcess.transcode(this.inFileName, outFileName, '-f s16be -ar 44100');
await this.ffmpegProcess.transcode(this.inFileName, outFileName, '-ac 2 -ar 44100 -f s16be');
let { data } = await this.ffmpegProcess.read(outFileName);
result = data.buffer;
} else {
const outFileName = `${this.outFileNameNoExt}.wav`;
await this.ffmpegProcess.transcode(this.inFileName, outFileName, '-f wav -ar 44100');
await this.ffmpegProcess.transcode(this.inFileName, outFileName, '-f wav -ar 44100 -ac 2');
let { data } = await this.ffmpegProcess.read(outFileName);
let bitrate: string = `0`;
switch (format) {