Translation:I found a knife when I was cleaning your room.
Because "sprzątałam," the past imperfect form, is used. This means "I was cleaning" and that the act occurred in the past but does not indicate that the action was completed. Whereas "posprzątałam," the past perfect form, translates to "I cleaned" and indicates that the act occurred in the past and was completed. Thus, "Znalazłam nóż, gdy posprzątałam twój pokój" would better correspond to your response.
Well, as I was told by some English natives, even simple "cleaned" could be interpreted as an imperfective verb (although it looks totally perfective to a Polish eye), and thus it's also a correct translation. Although "was cleaning" is surely better. Unfortunately this is not that easy and straightforward as we (I) would like it to be...
Znalazłem noś, gdy sprzątałem twój pokój was found incorrect but it underlined znalazłem when it seems like knife is the only thing that was incorrect. Edit: never mind. I just realised I'm being dense and it's because the recording is using the feminine and not the masculine. Duh!