Both are used interchangeably and in colloquial speech
I'm fairly sure nobody would correct you for using either.
Technically, " at " doesn't mean you are actually in the lecture.
For example you might say that you have "arrived at the store", which could simply mean you have reached the exterior of the store and have not yet entered it.
You may even use "at" when speaking about somewhere you have not yet reached, for example "I'm at a concert tonight".
Saying you are " in " somewhere is much more specific.
To be completely correct therefore you should use "I'm at a lecture" when speaking about attending a lecture in the future or if you had arrived at the venue, and only use "I'm in a lecture" if the lecture is in progress.
ell.stackexchange.com/users/66325/Astralbee
@Astralbee has already answered but In your context, I think that the correct one is I'm in a lecture now If you're talking with someone using a mobile device
and you want to hang up; or if you want to end a conversation because you have to go to the lecture, you can use some additional particle for emphasizing the present moment
Sorry, I'm in a lecture right now.
Byeeee.
Sorry, I'm currently in a lecture.
Byeeee.
During my "research", I found this in a students forum online.
It seems that someone was a bit bored.
ell.stackexchange.com/users/48962/RubioRic
In my experience you are more likely to hear 'in a lecture' than 'at a lecture', although either version is acceptable, This is supported by this Ngram .
Relying on my experience again, the use of 'I am in (a particular location)' or 'I am at (a particular location)' is inconsistently applied for different locations.
e.g. I have often heard 'I am at the movies', but never 'I am in the movies'.
To me, the latter implies that the person is an actor in a movie.
Similarly, I hear 'I am at school' more often than 'I am in school', but I hear 'I am in class' more often than 'I am at class'.
ell.stackexchange.com/users/76234/James
At X is used if X is a place.
Some properties of places are below.
people can freely enter and exit at any time.
it's a wide open area.
someone could give you directions to it if asked.
it's considered a public event
So using at X to refer to a lecture can usually work, especially if the place is dedicated to hosting lectures.
Can you be in a place?
You can be inside of its borders, fences, or buildings.
If a lecture is taking place at a lecture hall, in X would be reasonable.
In X can also be used
if X has some notion of a session - sessions have a start and end (borders) and saying you are "in" them means you are there while it's happening.
Since typically all lectures are planned and have well-defined start and stop times (sessions), in X has a higher chance of being appropriate.
ell.stackexchange.com/users/5144/LawrenceC
I would say "I am at the lecture now" is correct (though in practice "in" is also used (some answers here prove it)).
I'd use "at" because a lecture is a kind of event.
We would say "I'm at the meeting" or "I'm at the concert" for the same reason.
MyGrammarLab Intermediate by M.Foley and D.Hall explains it a bit differently though: To support my "event" idea, I'd like to refer to English Grammar in Use by R.Murphy:
Here are a few examples like that with "at"
+ event:
Both my friends are at the lecture.
At the lessons in our workshop you will be able to make any flower - exotic, bright and unique! Activities: Publication of compilation of speeches given at the seminar on international protection of human rights.
"In the lecture" is more like "during the lecture" (though my perception may be different from the one of some other people).
See the examples below:
She referred to Professor Jones's work in her lecture on Shakespeare's imagery.
In the second lecture you will learn about it.
Given all that, I assume "I'm at the lecture" is more grammatical.
ell.stackexchange.com/users/69600/Enguroo
Which preposition is the correct for being present in /at  lecture?    "Sorry,  I am  in  a lecture now",  or "I am  at  the lecture now"?
Am I in or at lecture?
ell.stackexchange.com
<prepositions>
ell.stackexchange.com/questions/169851
ell.stackexchange.com/users/12430/Judicious Allure
Both are used interchangeably.  You may even use "at" when speaking about somewhere you have not yet reached, for example "I'm at a lecture  tonight". Saying you are " in" somewhere is much more specific. While there is some difference in meaning between the two and 'at' would be more correct, both are used interchangeably in colloquial speech and 'in' might be more common. The rules are somewhat inconsistent and confusing, so you could say "at school", but "in class".
While there is some difference in meaning between the two and 'at' would be more correct, both are used interchangeably in colloquial speech and 'in' might be more common.  The rules are somewhat inconsistent and confusing, so you could say "at school", but "in class".