Making the recording in that circumstance is illegal, see §184 of the Criminal Code. Recording is illegal under §184(1), and the exceptions in subsection (2) do not include "if the content is a confession of a crime. §184.1(1) includes exceptions for an "agent of the state" to make non-consensual recordings if one party consents and
(b) the agent of the state believes on reasonable grounds that there
is a risk of bodily harm to the person who consented to the
interception; and (c) the purpose of the interception is to prevent
the bodily harm.
and in that circumstance the recording is admissible (and only "for the purposes of proceedings in which actual, attempted or threatened bodily harm is alleged, including proceedings in respect of an application for an authorization under this Part or in respect of a search warrant or a warrant for the arrest of any person", not including incidental confessions such as drug purchases). Therefore, the confession would be useless, without consent to record.
However, if you are a party to the conversation, you can record the conversation, thus the above only applies to e.g. recording conversations by sticking a recorder behind the couch and leaving. See §183:
Where a private communication is originated by more than one person or
is intended by the originator thereof to be received by more than one
person, a consent to the interception thereof by any one of those
persons is sufficient consent for the purposes of any provision of