Arduino + ultrasonic rangefinder behaving unexpectedly
I do not really understand the behaviour of your program, but I would
like to point out a couple of points that may be problematic:


Your comment says “Sends a 10 µs HIGH signal to the trigPin”, just as
the program you based yours on, yet you have a 30&nbsp;µs delay. If
this extra delay makes you miss the rising edge on the echo pin, then
pulseIn() will believe it is seen the previous pulse, and it will
wait for the next raising edge before starting its measurement. Since
that next rising edge will never happen, pulseIn() will eventually
time out after one second. This is probably the silence you are
hearing.
Your sound frequency may not be what you expect, because the time
needed to run through the loop is not only the two calls to
delay(), but also the time taken by pulseIn() and the various
delayMicroseconds(). You should have more consistent timings if you
use the tone() function instead of trying to bit-bang the sound.