How to listen Exported data (BLK) with component application

Hi, and thanks in advance

I wrote an application to view Exported data in Milestone format using the “VideoFileviewer” sample

It was very easy, then I’m trying to do the same with the Microphone exported data.

I have red the “AudioDemo” sample to learn how to use the audioPlayerControl.

I created a default server with the uri referred to the exported data,in the same way of case of VideoFileviewer.

I can see the Microphone devices, but I cannot hear the selected one.

By the way I have also inserteda playbackUserControl to try to go to the beginning of frame.

I report the interessed code:

private void btnSelectMicrofone_Click(object sender, EventArgs e)

{

if (_selectedMic != null)

  {

    \_audioPlayerControl1.Disconnect();

  }

  ItemPickerForm form = new ItemPickerForm();

  form.KindFilter = Kind.Microphone;

  form.AutoAccept = true;

  form.Init(Configuration.Instance.GetItems(ItemHierarchy.Both));

  if (form.ShowDialog() == DialogResult.OK)

  {

    \_selectedMic = form.SelectedItem;

    btnSelectMicrofone.Text = \_selectedMic.Name;

    if (\_playbackUserControlMic == null)

    {

      \_playbackUserControlMic = ClientControl.Instance.GeneratePlaybackUserControl();

      \_playbackUserControlMic.Dock = DockStyle.Top;

      \_playbackUserControlMic.ShowTallUserControl = true;

      \_playbackUserControlMic.ShowTimeSpanControl = true;

      \_playbackUserControlMic.ShowSpeedControl = true;

      \_playbackUserControlMic.Refresh();

      panel2.Controls.Clear();

      panel2.Controls.Add(\_playbackUserControlMic);

      \_playbackUserControlMic.Refresh();

    }

    if (\_playbackFQIDMic == null)

    {

      \_playbackFQIDMic = ClientControl.Instance.GeneratePlaybackController();

      \_playbackUserControlMic.Init(\_playbackFQIDMic);

    }

    \_audioPlayerControl1.MicrophoneFQID = \_selectedMic.FQID;

    \_audioPlayerControl1.PlaybackControllerFQID = \_playbackFQIDMic;

    EnvironmentManager.Instance.Mode = Mode.ClientPlayback;

     \_audioPlayerControl1.Initialize();

    \_audioPlayerControl1.Connect();

    \_playbackUserControlMic.Show();

    \_playbackUserControlMic.SetEnabled(true);  

    \_audioPlayerControl1.StartBrowse();

    EnvironmentManager.Instance.SendMessage(new VideoOS.Platform.Messaging.Message(

                          VideoOS.Platform.Messaging.MessageId.System.ModeChangeCommand,

                          Mode.ClientPlayback), \_playbackFQIDMic);

Can you please explore a sample VideoViewer2Playback -

https://doc.developer.milestonesys.com/html/index.html?base=samples/videoviewer2playback_sample.html&tree=tree_search.html?search=videoviewer2playback

You will find the following code,

foreach (Item item in related)
	if (item.FQID.Kind == Kind.Microphone)
	{
		_related1Microphone = item;
		_audioPlayerControl1Microphone.MicrophoneFQID = _related1Microphone.FQID;
		break;
	}
foreach (Item item in related)
     	if (item.FQID.Kind == Kind.Speaker)
	{
		_related1Speaker = item;
              _audioPlayerControl1Speaker.SpeakerFQID = _related1Speaker.FQID;
              break;
	}

You need to set up with Microphone’s and Speaker’s FQID.

Thanks Rie Kito,

I saw the sample but I’m triyng to attach to exported Data in Milestone format not to a classic recording server.

My related item are empty becouse I can connect in a mutually exclusive way to the video part or the audio part

if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)

    **{**

      **\_selectedStoragePath = folderBrowserDialog1.SelectedPath;**

    **}**

    **else**

    **{**

      **return;**

    **}**

    **DirectoryInfo di = new DirectoryInfo(\_selectedStoragePath);**

    **if (File.Exists(Path.Combine(\_selectedStoragePath, "cache.xml")) ||**

        **File.Exists(Path.Combine(\_selectedStoragePath, "archives\_cache.xml")))**

      **{**

        **bool done = false;**

        **string password = "123Stella!!!";**

        **while (!done)**

        **{**

          **VideoOS.Platform.SDK.Environment.RemoveAllServers();**

          **Uri uri = new Uri("fil[e:\\\\](file:e://)" + \_selectedStoragePath);**

          **VideoOS.Platform.SDK.Environment.AddServer(uri, new System.Net.NetworkCredential("gpalmieri", password));**

          **try**

          **{**

            **VideoOS.Platform.SDK.Environment.Login(uri);**

            **VideoOS.Platform.SDK.Environment.LoadConfiguration(uri);**

            **done = true;**

          **}**

          **catch (NotAuthorizedMIPException)**

          **{**

Yes. You will need to add the Microphone same way as the Camera; from file system. The VideoFileViewer does this for video only you need to do the same with the audio.