That will play the same sound for each and every query message received, which is not what the OP asked for.
The OP clearly stated that they wanted two different sounds, one when the query is started, and another when text is received in a query that isn't the current active window.