To check if the radio is in the same room as the player, you can say "if the radio is enclosed by the location." ("The location" is short for "the location of the player".) This condition (as opposed to "if the radio is in the location") would be true even if the radio is carried by the player, or is inside a container in the same room. There's more on enclosure in §3.25 of Writing with Inform.
I'm not sure what you'd want the conditions to be for deciding whether something is audible. You could skip the enclosure condition and substitute a touchability condition (see §6.13) if you don't want the radio to be audible from inside a closed container.
To create a "heard" condition, you could use "to decide if" (see §11.16 of Writing with Inform).
Place is a room.
A radio is a device in Place. A container called battery-compartment is part of the radio. The printed name of battery-compartment is "battery compartment". Understand "battery/-- compartment" as the battery-compartment.
Some batteries are in the battery-compartment.
Instead of listening to the radio:
if the radio is heard:
Say "Static comes from the radio.";
Otherwise:
Say "You can't hear anything coming from the radio."
To decide if the radio is heard:
if the radio is enclosed by the location:
if the radio is switched on:
if the battery-compartment encloses the batteries:
yes;
no.
Test me with "listen to radio / switch on radio / listen to radio".
The way my example is set up, though, there's actually not much use for specifying that the radio has to be enclosed by the location, because the listening action already requires a touchable noun (you can see this if you click the Index tab and then the Actions tab, and scroll down to the alphabetical list of actions). If the radio is not enclosed by the location, it's not going to be touchable.