Skip to content

Commit aaa103a

Browse files
fix(audio): ensure full WhatsApp compatibility for audio conversion (libopus, 48kHz, mono)
1 parent ccbd866 commit aaa103a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3001,7 +3001,20 @@ export class BaileysStartupService extends ChannelStartupService {
30013001
.noVideo()
30023002
.audioCodec('libopus')
30033003
.addOutputOptions('-avoid_negative_ts make_zero')
3004+
.audioBitrate('128k')
3005+
.audioFrequency(48000)
30043006
.audioChannels(1)
3007+
.outputOptions([
3008+
'-write_xing', '0',
3009+
'-compression_level', '10',
3010+
'-application', 'voip',
3011+
'-fflags', '+bitexact',
3012+
'-flags', '+bitexact',
3013+
'-id3v2_version', '0',
3014+
'-map_metadata', '-1',
3015+
'-map_chapters', '-1',
3016+
'-write_bext', '0'
3017+
])
30053018
.pipe(outputAudioStream, { end: true })
30063019
.on('error', function (error) {
30073020
console.log('error', error);

0 commit comments

Comments
 (0)