This sound is really worrying and might indicate the internal drive belt breaking. My motor was damaged after 8,000+ miles ridden. I could hear a rhytmical clicking from the motor area that was independent of cadence and sometimes disappeared (it took many rides before the motor broke).
At the last ride, I heard a very loud noise from the motor, and assistance was not delivered anymore. I think "Motor Error" message appeared but the system switched off almost instantly.
I had to have the motor replaced by Specialized LBS for around $1,000. The motor was readily available for the Specialized LBS by the regional distributor.