You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a code that is written in Typescript that takes in two streams of audio and combines them into one. Below is the TypeScript Code. Can anyone help how this can be done in python using this package?
`const leftStream = await getKvsStream(`gprc-${callId}-AGENT`);
const rightStream = await getKvsStream(`gprc-${callId}-CUSTOMER`);
logger.info(`############ Begin piping KVS streams for callId ${callId}`);
const ffmpegProcess = spawn('ffmpeg', [
'-y', // Overwrite output files without asking
'-re', // Read input at native frame rate
'-f', 'matroska', '-i', 'pipe:3', // Input stream from pipe 3 (left stream)
'-re', // Read input at native frame rate
'-f', 'matroska', '-i', 'pipe:4', // Input stream from pipe 4 (right stream)
'-filter_complex', '[0:a][1:a]join=inputs=2:channel_layout=stereo[a]', // Combine streams into separate tracks
'-map', '[a]', // Map the combined audio to the output
'-c:a', 'pcm_s16le', // Audio codec
'-ar', '8000',
'-f', 's16le', // Output format as PCM RAW
'pipe:1' // Output stream to pipe
], {
stdio: ['pipe', 'pipe', 'pipe', 'pipe', 'pipe'] // Create extra pipes
});
leftStream.pipe(ffmpegProcess.stdio[3] as Writable);
rightStream.pipe(ffmpegProcess.stdio[4] as Writable);
const transcribeStream = new PassThrough();
const combinedStream = new PassThrough();
ffmpegProcess.stdout.pipe(combinedStream);
combinedStream.pipe(transcribeStream);
transcribe.transcribeCombinedAudioStream(transcribeStream, callId, 8000)`
The text was updated successfully, but these errors were encountered:
I have a code that is written in Typescript that takes in two streams of audio and combines them into one. Below is the TypeScript Code. Can anyone help how this can be done in python using this package?
The text was updated successfully, but these errors were encountered: