A non-transitory computer-readable storage medium, having stored thereon program instructions that, upon execution by one or more processors, cause performance of a set of operations for dynamically controlling enhancement of an audio stream, wherein the audio stream defines a sequence of audio segments over time, including at least a first audio segment and a second audio segment, and wherein each audio segment defines a waveform having a plurality of waveform attributes and, for each waveform attribute in the plurality, having a respective waveform-attribute value as a characteristic of the audio segment, the operations comprising:
- for each audio segment of the sequence of audio segments, (i) determining a set of the waveform-attribute values of the audio segment's waveform attributes, (ii) computing a first distance between the determined set of waveform-attribute values and a first predefined set of waveform-attribute values representative of speech, and computing a second distance between the determined set of waveform-attribute values and a second predefined set of waveform-attribute values representative of music, and (iii) using the computed first and second distances as a basis to classify the audio segment as primarily speech or rather primarily music, wherein the first audio segment is classified as primarily speech rather than primarily music, and wherein the second audio segment is classified as primarily music rather than primarily speech;
- based at least on the first audio segment being classified as primarily speech rather than primarily music, applying speech enhancement to the first audio segment, wherein applying speech-enhancement to the first audio segment takes at least a predetermined length of time;
- and
- based at least on the second audio segment being classified as primarily music rather than primarily speech, not applying speech enhancement to the second audio segment, wherein not applying speech enhancement to the second audio segment comprises delaying output of the second audio segment by at least the predetermined length of time.