Possible bug in audio playback?

Hiya,

I have a standalone app that needs to play previously recorded audio and video. I’ve noticed that the following code doesn’t play audio. By removing the 2 playback commands ( line 26 to 32 in the extract below) from this ‘set up’ code and placing them into a button click event will then play the audio. The video plays under both scenarios.

Any ideas?

_viewerControl = ClientControl.Instance.GenerateImageViewerControl();
            _viewerControl.Dock = DockStyle.Fill;
            panelVideo.Controls.Add(_viewerControl);
 
            _viewerControl.CameraFQID = cameraItem.FQID;
            _viewerControl.Initialize();
            _viewerControl.Connect();
            _viewerControl.Selected = true;
 
            List<Item> related = cameraItem.GetRelated();
            if (related != null)
            {
                foreach (Item item in related)
                {
                    if (item.FQID.Kind == Kind.Microphone)
                    {
                        _audioControl.MicrophoneFQID = item.FQID;
                        _audioControl.Initialize();
                        _audioControl.Connect();
                        _audioControl.StartBrowse();
                        break;
                    }
                }
            }
 
            PlaybackCommandData command = new PlaybackCommandData { Command = PlaybackData.Goto, DateTime = _data.Times.StartTime };
            VideoOS.Platform.Messaging.Message message = new VideoOS.Platform.Messaging.Message(MessageId.SmartClient.PlaybackCommand, command);
            EnvironmentManager.Instance.SendMessage(message);
 
            command = new PlaybackCommandData { Command = PlaybackData.PlayForward, Speed = 1.0 };
            message = new VideoOS.Platform.Messaging.Message(MessageId.SmartClient.PlaybackCommand, command);
            EnvironmentManager.Instance.SendMessage(message);

It is important that the AudioControl is initiated and is on the UI before used. Can you verify you have this in place? Could you please test for reference, if you use the VideoViewer2WayAudio sample, can you hear audio from a camera?

Yes, the audio control is created and added to the forms controls in the form constructor. The above code was in a form.Load method.

The whole form and its controls need be completely *shown*, not just constructed, before getting audio?

Even though the video displays and plays OK?

Yes, needs to be *shown* (needs windows handle). I believe the ImageViewerControl (since updated in 2016 R3) is not touchy like this.

OK, thank you. That’s great!