Semiconducting polymers owe their optoelectronic properties to the delocalized electronic structure along their conjugated backbone. Their spectral features are therefore uniquely sensitive to the conformation of the polymer, where mechanical stretching of the chain leads to distinct vibronic shifts. Here we demonstrate how the optomechanical response of conjugated polyelectrolytes can be used to detect their encapsulation in a protein capsid. Coating of the sensor polymers by recombinant coat proteins induces their stretching due to steric hindrance between the proteins. The resulting mechanical planarizations lead to pronounced shifts in the vibronic spectra, from which the process of capsid formation can be directly quantified. These results show how the coupling between vibronic states and mechanical stresses inherent to conjugated polymers can be used to noninvasively measure strains at the nanoscale.