We can use the wrapper here, so
``
$wrapper = entity_metadata_wrapper('node', $node);
// Get the group IDs.
$ids = $wrapper->{OG_AUDIENCE_FIELD}->value(array('identifier' => TRUE));
``