Two way real time talking system

Hi guys!
I want to make a two way realtime talking system with arduino
A system that gets the analog output of mic ,, convert it to digital and transfer it to another board, the digital data converts to analog again and play from the speaker
How can i do that?

Alexander Bell has invented something like a 150 years ago... the thing was calling telephone...

Welcome to the Arduino forum. How many other Arduino projects have you satisfactorily completed?

Begin by getting your two Arduino boards to communicate using some serial protocol. Likely using the tutorials on the forum relating to communications.

Do not ever jump into the final part of a project and try to work backwards to figure out the errors.

Start small, with a microphone and an Arduino, and learn to digitize and transmit the digitized voice signals to your PC. Then learn how to play back those digital signals through a speaker.

Once you understand the limitations you will be in good shape to plan the rest of the project.

Break down your project in pieces to get working. Analyze your design task, and afterwards synthesize.

Here a list of questions I would raise for myself doing your project:

  • do I have MIC on board I am using? (which type and audio format? a sample code available)
  • do I have Audio Out (speaker, LineOut) available? (which type and audio format? a sample code available)
  • Assuming, MIC and OUT can be initialized and used for audio: how to transfer the audio?
    via USB, via Network, via own wires (e.g. like a UART)?
  • how to synchronize both sides?
    Audio needs a reference clock: both sides have to use the same clock. How to bring the audio
    clock over "long distance connection"?
    What if both sides use a (slightly) different clock?

Converting digital to analog: called DAC:

  • do you have a DAC chip on board? (MCU cannot generate audio as analog really without external chips).

Converting analog (audio IN) to digital:

  • how do you connect MICs?
  • if they are onboard, as digital PDM MICs - fine: MCU gets the MIC as digital,
    but if you want to connect a real analog MIC - ADC needed,
    or via USB: do you have "USB Stack" for getting (digital) audio via USB?

All is "possible" (can be imagined): it just depends what do you have, what do you need (HW and SW vise), what do you have to do?
A "design review" helps: analyze the "big task", break it down to smaller tasks, find approaches how to implement each (small) task - synthesize all building blocks/tasks to a system and start implementing the code when all clear.

Thank you tjaekel!
Can i use I2S mic with arduino board?

I do not know which Arduino board you use (and if it has free pins for I2S).
BTW: I2S is digital audio (PCM format) but I am not aware of any MIC with I2S.
Potentially, you need an ADC, with analog in from MIC, providing I2S. If MCU has I2S inputs (free pins, an I2S block, STM calls it SAI) - with external ADC chip you can do.

You can also check if PDM MICs are possible (a digital signal from MIC, but needs a PDM interface). My boards have PDM MICs on it (e.g. Portenta H7).

Other option:
Use USB and a MIC via USB: but you have to bringup USB host on MCU and "aggregate USB MIC" is external device.