Simultaneous two Speaker Output


i wanted to know how i would be able to output tones to two speakers, playing different notes simultaneously.

As of now i can only play tones out of 2 speakers but at different times. so how could i make them simultaneous.

this is the code i have

void setup() {
  pinMode (4, OUTPUT);

void fourFunction() {
    buzz(4, 1567, 250); 
    buzz(4, 1479, 250);  
    buzz(4, 1318, 250);  
    buzz(4, 1318, 250);  
    buzz(4, 1479, 750);

void loop() {

void buzz(int targetPin, long frequency, long length) {
    long delayValue = 1000000/frequency/2; 
    long numCycles = frequency * length/ 1000; 
    for (long i=0; i < numCycles; i++){

This method is blocking, since the delay time depends on the frequency. Have a look at the Tone library, which is non-blocking.