The police only have to inform you of your Miranda rights if you are 1. formally in custody and 2. are being interrogated. Police can use anything you say against you, even before you have heard your rights, if either of these conditions isn’t met.