• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FSX Multiplayer Voice Capture

Messages
4
Country
ca-ontario
Hello, working on trying to identify which player in a multiplayer session is talking, either on their own freq or broadcasting on all.. The code below successfully identifies both events, however only when they occur from the computer running the application, when network multiplayer pilots talk either on a single freq or broadcast the app fails to identify either event. Any ideas how I should change this to identify a) the MP_VOICE_CAPTURE_START and MP_BROADCAST_VOICE_CAPTURE_START events from anyone connected to the session and b)who it is (by dwObjectId perhaps)?

Private Sub initializeDefinitionsAndEvents()
AddHandler fsxconnect.OnRecvEvent, New SimConnect.RecvEventEventHandler(AddressOf RecvEvent)
AddHandler fsxconnect.OnRecvOpen, New SimConnect.RecvOpenEventHandler(AddressOf SimConnectRecvOpen)
AddHandler fsxconnect.OnRecvQuit, New SimConnect.RecvQuitEventHandler(AddressOf SimConnectRecvQuit)
AddHandler fsxconnect.OnRecvEventMultiplayerServerStarted, New SimConnect.RecvEventMultiplayerServerStartedEventHandler(AddressOf MultiPlayerStarted)
AddHandler fsxconnect.OnRecvEventMultiplayerSessionEnded, New SimConnect.RecvEventMultiplayerSessionEndedEventHandler(AddressOf MultiPlayerEnded)
AddHandler fsxconnect.OnRecvEventObjectAddremove, New SimConnect.RecvEventObjectAddremoveEventHandler(AddressOf AddRemoveSimConnectObject)
AddHandler fsxconnect.OnRecvException, New SimConnect.RecvExceptionEventHandler(AddressOf SimConnectException)


fsxconnect.SubscribeToSystemEvent(EventIDs.EVENT_AddObject, "ObjectAdded")
fsxconnect.SubscribeToSystemEvent(EventIDs.EVENT_RemoveObject, "ObjectRemoved")
fsxconnect.SubscribeToSystemEvent(EventIDs.EVENT_MultiplayerServerStarted, "MultiplayerServerStarted")
fsxconnect.SubscribeToSystemEvent(EventIDs.EVENT_MultiplayerSessionEnded, "MultiplayerSessionEnded")

fsxconnect.MapClientEventToSimEvent(EventIDs.EVENT_MPVoiceCaptureStart, "MP_VOICE_CAPTURE_START")
fsxconnect.AddClientEventToNotificationGroup(NOTIFICATION_GROUP.COMMS, EventIDs.EVENT_MPVoiceCaptureStart, False)
fsxconnect.MapClientEventToSimEvent(EventIDs.EVENT_MPBroadcastVoiceCaptureStart, "MP_BROADCAST_VOICE_CAPTURE_START")
fsxconnect.AddClientEventToNotificationGroup(NOTIFICATION_GROUP.COMMS, EventIDs.EVENT_MPBroadcastVoiceCaptureStart, False)
fsxconnect.SetNotificationGroupPriority(NOTIFICATION_GROUP.COMMS, SimConnect.SIMCONNECT_GROUP_PRIORITY_DEFAULT)

fsxconnect.AddToDataDefinition(DEFINITIONS.StructMultiplayerAircraft, "Title", "", Microsoft.FlightSimulator.SimConnect.SIMCONNECT_DATATYPE.STRING256, 0, 0)
fsxconnect.AddToDataDefinition(DEFINITIONS.StructMultiplayerAircraft, "ATC Type", "", Microsoft.FlightSimulator.SimConnect.SIMCONNECT_DATATYPE.STRING32, 0, 1)
fsxconnect.AddToDataDefinition(DEFINITIONS.StructMultiplayerAircraft, "ATC Model", "", Microsoft.FlightSimulator.SimConnect.SIMCONNECT_DATATYPE.STRING32, 0, 2)
fsxconnect.AddToDataDefinition(DEFINITIONS.StructMultiplayerAircraft, "ATC ID", "", Microsoft.FlightSimulator.SimConnect.SIMCONNECT_DATATYPE.STRING32, 0, 3)
fsxconnect.AddToDataDefinition(DEFINITIONS.StructMultiplayerAircraft, "ATC Airline", "", Microsoft.FlightSimulator.SimConnect.SIMCONNECT_DATATYPE.STRING64, 0, 4)
fsxconnect.AddToDataDefinition(DEFINITIONS.StructMultiplayerAircraft, "ATC Flight Number", "", Microsoft.FlightSimulator.SimConnect.SIMCONNECT_DATATYPE.STRING8, 0, 5)
fsxconnect.AddToDataDefinition(DEFINITIONS.StructMultiplayerAircraft, "Plane Latitude", "degrees", Microsoft.FlightSimulator.SimConnect.SIMCONNECT_DATATYPE.FLOAT64, 0, 6)
fsxconnect.AddToDataDefinition(DEFINITIONS.StructMultiplayerAircraft, "Plane Longitude", "degrees", Microsoft.FlightSimulator.SimConnect.SIMCONNECT_DATATYPE.FLOAT64, 0, 7)
fsxconnect.AddToDataDefinition(DEFINITIONS.StructMultiplayerAircraft, "Plane Altitude", "feet", Microsoft.FlightSimulator.SimConnect.SIMCONNECT_DATATYPE.FLOAT64, 0, 8)
fsxconnect.AddToDataDefinition(DEFINITIONS.StructMultiplayerAircraft, "SIM On Ground", "Bool", Microsoft.FlightSimulator.SimConnect.SIMCONNECT_DATATYPE.FLOAT32, 0, 9)
fsxconnect.AddToDataDefinition(DEFINITIONS.StructMultiplayerAircraft, "COM ACTIVE FREQUENCY:1", "MHz", Microsoft.FlightSimulator.SimConnect.SIMCONNECT_DATATYPE.FLOAT32, 0, 10)
fsxconnect.AddToDataDefinition(DEFINITIONS.StructMultiplayerAircraft, "COM ACTIVE FREQUENCY:2", "MHz", Microsoft.FlightSimulator.SimConnect.SIMCONNECT_DATATYPE.FLOAT32, 0, 11)
' IMPORTANT: register it with the simconnect managed wrapper marshallergg
' if you skip this step, you will only receive an int in the .dwData field.
fsxconnect.RegisterDataDefineStruct(Of StructMultiplayerAircraft)(DEFINITIONS.StructMultiplayerAircraft)

AddHandler fsxconnect.OnRecvSimobjectDataBytype, New SimConnect.RecvSimobjectDataBytypeEventHandler(AddressOf RecvSimobjectDataBytype)
End Sub

..
..
..

Private Sub RecvEvent(ByVal sender As SimConnect, ByVal data As SIMCONNECT_RECV_EVENT)

Select Case data.uEventID
Case EventIDs.EVENT_MPVoiceCaptureStart
Debug.Print("##-->TALKING")
fsxconnect.Text(SIMCONNECT_TEXT_TYPE.PRINT_RED, 3.0F, RequestID.DisplaySetData, "TALKING!")
Case EventIDs.EVENT_MPBroadcastVoiceCaptureStart
Debug.Print("#########> ALL FREQ BROADCASTING!")
End Select

End Sub
 
Last edited:
Back
Top