There are soooooo many reasons that is never going to work well at all:
1) Due DAC and ADC resolution is only 12 bits, which is poor for audio.
2) For analogRead, default conversion time is about 100 uSec, which means a sample rate of only 10kHz. Again, very poor for audio. Perhaps on the Due it runs faster, not sure.
3) Sampling an a software loop will mean LOTS of jitter in the sample rate, which makes for lots of distortion and aliasing.
If you want the best quality you can get, which will still be poor, you need to do register-level programming, and setup a DMA controller to read and buffer the data, and another DMA controller to transfer the data from the buffer to the A/D. You'll then need interrupt handlers to deal with the buffer management.
Personally, I think you're wasting your time, as the audio quality will be poor at best unless you add external 16-24-bit I2S ADCs and DACs.
Regards,
Ray L.