Hi,
Welcome to Microsoft Q&A!
According to the Doc: IAudioSessionManager2::RegisterSessionNotification method
You must call IAudioSessionEnumerator::GetCount to begin receiving notifications. The session enumeration API discards new session notifications until the application has first retrieved the list of existing sessions. This is to prevent a race condition that can occur when a session notification arrives while the application using the session APIs is starting up. Calling GetCount triggers the enumeration API to begin sending session notifications.
I suggest you could refer to the steps to receive session notifications and manage a list of current sessions.
Best Regards,
Jeanine
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.