your question reminds me on a YouTube video where a robot has been trained not to be scared if a 2nd big robot appears in his environment...
I'll suggest to write a subsumption program
with at least 2 elementary behavior routines:
cruise() // dark surface or sound: drive around, whistle a happy song
scared() // white surface, but no sound : stop, squeeze, turn, toggle and go back
maybe you'll need a 3rd behavior
avoid() // to avoid obstacles
a 4th behavior
escape() // searching his dark and save home as quick as possible, his heart bumping quick and loud
a 5th behavior
cooldown() // staying at home in a dark corner and waiting until becoming calm
and maybe you'll need a 6th behavior
cautious() // is already a little accustomed to the white surface or not quite sure about that: slow down, listen, look a little to the left and right side
if you want to train
your robot to subsequently loose his initial fear of an unknown environment if a sound signal appears, in this case you'll wish to combine cautious() and scared() with a neural net.
I'm actually not sure if you are a more advanced programmer - if you're not, I'll suggest not to try this, I'm afraid this project will lead to a big frustration...