Spectral geometry for strings and branes