Only Admissions while in Detention Trigger Miranda
The answer by Dale M is correct, the Miranda warnings are required only when officers have arrested or are detaining a person, and question that person. In that case, and only in that case, nothing that the person says is admissible unless the person has been informed of the right not to make statements, the right to consult with a lawyer, and the right to have a lawyer appointed if unable to afford one, and after being so informed agrees to make statements or answer questions.
History Behind Miranda
There is history behind the Miranda rule, more fully Miranda v. Arizona, 384 U.S. 436 (1966)
In the decades prior to the Miranda decision, there had been a series of US court cases over confessions and admissions by accused criminals. In Brown v. Mississippi, 297 U.S. 278 (1936) The US Supreme Court rules that confessions extracted by police violence were not admissible in criminal proceedings. (In that case a Deputy and others beat the accused men with leather straps until they confessed, and continued to do so until the confessions were adjusted to the dictation of the Deputy.)
In Chambers v. Florida, 309 U.S. 227 (1940) the Court held that extensive police pressure, including the accused having been held in isolation for over a week with repeated questioning, resulted in confessions that were not voluntary and thus not admissible.
In a series of subsequent cases from 1940 to the 1960s, US courts continued to deal with when confessions were "voluntary" and could be admitted into criminal trials. Various police tactics were held to be coercive and thus taint confessions.
The Miranda case was the endpoint of this series, in which the court held that detention by the police was an inherently coercive situation, and a confession could only be accepted if the accused was made aware of the rights to silence and to a lawyer. Since it is police detention that raises this coercive situation, it is only admissions during detention that require the warnings.