AgoraIO-Community / Agora-Python-SDK

Use Agora RTC SDK with Python!
MIT License
69 stars 25 forks source link

How to Record multiple Audio channels simultaneously by IChannel #10

Open pirouz14 opened 3 years ago

pirouz14 commented 3 years ago

I want to record and store "local mp3 file" as output from multiple live streaming audio channels simultaneously. Without playback any sound on the device speakers.

I guess it works with IChannel.

YiqingJackieHuang commented 3 years ago

startAudioRecording() allows mixing all audio streams in multiple channels and store in a single audio recording file. If you would like to disable all playback sound, you need to call registerAudioFrameObserver() before joining these channels as well as to return a False value to onPlaybackAudioFrame() in audioFrameObserver in order to stop pushing all playback audio streams to Agora SDK rendering module.

However, if you would like to record sound from different channels separately and store them into multiple audio files, Agora SDK does not have an API to achieve it. Thus, you need to implement it yourself. More specifically, obtain all audio streams from multiple channels via onPlaybackAudioFrameBeforeMixingEx() in audioFrameObserver, mix them as your requirement, and save them into multiple files.

pirouz14 commented 3 years ago

Thank you very much for your help. I have not used C++ before to develop Python API. could you please tell me the roadmap for it?

zhangtao1104 commented 3 years ago

You can use the api named startAudioRecording() in python. We have this api in python sdk.