One embodiment of the present invention sets forth an earplug (100) for selectively providing sound to a user. The earplug includes a microphone (110), a processing unit (120), and a speaker (115). The microphone (110) is configured to acquire ambient sound. The processing unit (120) is configured to determine that a first sound included in the ambient sound is associated with a first set of sound parameters and, in response, generate a first cancellation signal associated with the first sound. The processing unit (120) is further configured to determine that a second sound included in the ambient sound is associated with a second set of sound parameters and, in response, generate a second signal to cause the second sound to be produced. The speaker (115) is configured to produce one or more sound waves based on the first cancellation signal to cancel the first sound from the ambient sound and produce the second sound based on the second signal.