how to drive a speaker from a r2r ladder

To have the data come out at a predetermined rate, you could have your loop only execute the a shiftout every 32uS.
This code checks for 100uS intervals to elapse & then does stuff - set up yours similar but using 32uS (1/32150)

void loop(){
  // *******************************************************************
  // start timing interval

  currentMicros = micros();  // sample the time
  if (currentMicros - previousMicros >= hundred_uS_interval) // more than our interval?
  {
    // save the last time we okayed time updates 
    previousMicros = currentMicros; // save the current time for next comparison
    toggle = 1-toggle;  // results in 0 1 0 1 ...                                                                                                                                     

    // do stuff on 0.1mS intervals, 1mS intervals, ets.

   
  }  // end of time interval
} // end of void loop