There is no reason to think that "audience" is being treated as plural in the sentence, so why would you object to a / an? (I assume you've come across "a family", "a group", "a class", "a school", "a government", "a team".)
However, even when collective nouns are treated as plural, they can still take the indefinite article a / an. We could say, for example, "when an audience are happy with a performance, they often applaud", "when a government are disunited, the opposition often benefits", or "when a couple are fighting, their children often notice".
From Kevin Bridges in The Guardian, 15th October 2014:
When an audience are in raptures at a part of the show, the fear of the next bit not being as funny or causing a dip will set in but you can navigate that.
From Clare Dyson, AusDance, 2008:
Will an audience understand that they are voyeurs if they watch through peepholes?
Jodie Helm quoted in Caroline Heim's Audience As Performer, 2016:
Usher Jodie Payne knows when an audience "are really fragile, angry, enjoying themselves, visibly upset or offended".
Is your misconception that collective nouns can't take the indefinite article perhaps based on a confusion between collective nouns and mass nouns? These are two different things. "Audience" is almost always a countable noun (and according to Oxford, the use of "audience" as a mass noun is archaic). It is true that mass nouns can't take the indefinite article (although many mass nouns can be treated as countable under certain circumstances, often with a slightly different meaning - and when treated as countable, they can take the indefinite article - e.g. "a cheese" meaning "a type of cheese").