@@ -1146,8 +1146,8 @@ export class WAStartupService {
11461146 let outputAudio : string ;
11471147
11481148 if ( isURL ( audio ) ) {
1149- outputAudio = `${ join ( process . cwd ( ) , 'temp' , 'audio.opus ' ) } ` ;
1150- tempAudioPath = `${ join ( process . cwd ( ) , 'temp' , 'audio .mp3' ) } ` ;
1149+ outputAudio = `${ join ( process . cwd ( ) , 'temp' , 'audio.mp4 ' ) } ` ;
1150+ tempAudioPath = `${ join ( process . cwd ( ) , 'temp' , 'audioTemp .mp3' ) } ` ;
11511151
11521152 const response = await axios . get ( audio , { responseType : 'arraybuffer' } ) ;
11531153 fs . writeFileSync ( tempAudioPath , response . data ) ;
@@ -1161,7 +1161,8 @@ export class WAStartupService {
11611161
11621162 return new Promise ( ( resolve , reject ) => {
11631163 exec (
1164- `${ ffmpegPath . path } -i ${ tempAudioPath } -c:a libopus ${ outputAudio } -y` ,
1164+ // `${ffmpegPath.path} -i ${tempAudioPath} -c:a libopus ${outputAudio} -y`,
1165+ `${ ffmpegPath . path } -i ${ tempAudioPath } -vn -ab 128k -ar 44100 -f ipod ${ outputAudio } -y` ,
11651166 ( error , _stdout , _stderr ) => {
11661167 fs . unlinkSync ( tempAudioPath ) ;
11671168 if ( error ) reject ( error ) ;
@@ -1179,11 +1180,9 @@ export class WAStartupService {
11791180 data . number ,
11801181 {
11811182 audio : Buffer . from ( audio , 'base64' ) ,
1182- // audio: isURL(data.audioMessage.audio)
1183- // ? { url: data.audioMessage.audio }
1184- // : Buffer.from(data.audioMessage.audio, 'base64'),
11851183 ptt : true ,
1186- mimetype : 'audio/ogg; codecs=opus' ,
1184+ // mimetype: 'audio/ogg; codecs=opus',
1185+ mimetype : 'audio/mp4' ,
11871186 } ,
11881187 { presence : 'recording' , delay : data ?. options ?. delay } ,
11891188 ) ;
0 commit comments