Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Record calls #16

Open
adamrobertolo78 opened this issue Oct 18, 2024 · 4 comments
Open

Record calls #16

adamrobertolo78 opened this issue Oct 18, 2024 · 4 comments

Comments

@adamrobertolo78
Copy link

Hi there,
Thanks a lot for the repo! How could I record the calls?
Thank you in advance.

@swarajban
Copy link

This can be done in via TwiML https://www.twilio.com/docs/voice/twiml/record

@lanceyuu
Copy link

lanceyuu commented Nov 1, 2024

I try the TwiML but always have errors. In the end, I just record it in my local PC. Very simple

@adamrobertolo78
Copy link
Author

Hi @lanceyuu , would you mind sharing how you do it?
Thank you in advance!

@lanceyuu
Copy link

lanceyuu commented Nov 4, 2024

hi @adamrobertolo78

i add the following code to main.py

incoming_audio_path = f"recordings/incoming_audio_{int(asyncio.get_event_loop().time())}.raw"
outgoing_audio_path = f"recordings/outgoing_audio_{int(asyncio.get_event_loop().time())}.raw"

os.makedirs('recordings', exist_ok=True)  # Ensure the recordings directory exists

incoming_file = await aiofiles.open(incoming_audio_path, mode='wb')
outgoing_file = await aiofiles.open(outgoing_audio_path, mode='wb')

Also, you can use this file to convert the raw recording to wmv file.
https://github.com/lanceyuu/Automated-Interviews-Ai/blob/main/convert.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants