none
Kinect Studio Api playback not firing frame arrive events RRS feed

  • Question

  • I have recorded files using Kinect studio api and want to playback these files but using the playback sample code no frameArrive events are being triggered?

       public void PlaybackClip(string filePath, uint loopCount)
            {
                using (KStudioClient client = KStudio.CreateClient())
                {
                    client.ConnectToService();
                   
               
                    
             

                    using (KStudioPlayback playback = client.CreatePlayback(filePath))
                    {
                      
                        playback.LoopCount = loopCount;
                        playback.Start();
                        
                        while (playback.State == KStudioPlaybackState.Playing)
                        {
                            
                            Thread.Sleep(500);
                             }

                        if (playback.State == KStudioPlaybackState.Error)
                        {
                            throw new InvalidOperationException("Error: Playback failed!");
                        }
                    }

                    client.DisconnectFromService();
                }
            }
       public void PlaybackClip(string filePath, uint loopCount)
            {
                using (KStudioClient client = KStudio.CreateClient())
                {
                    client.ConnectToService();
                   
               
                    
             

                    using (KStudioPlayback playback = client.CreatePlayback(filePath))
                    {
                      
                        playback.LoopCount = loopCount;
                        playback.Start();
                        
                        while (playback.State == KStudioPlaybackState.Playing)
                        {
                            
                            Thread.Sleep(500);
                             }

                        if (playback.State == KStudioPlaybackState.Error)
                        {
                            throw new InvalidOperationException("Error: Playback failed!");
                        }
                    }

                    client.DisconnectFromService();
                }
            }

    Friday, June 26, 2015 9:48 PM

Answers

  • You should be able to see your clip playback if you start one of the basic samples (body, depth, color, or IR). However, you won't be able to see it play when running Kinect Studio, because it needs to connect to the same service as your program.

    If you want to visualize playback in your program, or capture incoming frame data, then try running playback on a different thread. You won't get any frames while playback is occurring, if the main thread is sleeping.

    ~Angela


    Saturday, June 27, 2015 12:22 AM

All replies

  • You should be able to see your clip playback if you start one of the basic samples (body, depth, color, or IR). However, you won't be able to see it play when running Kinect Studio, because it needs to connect to the same service as your program.

    If you want to visualize playback in your program, or capture incoming frame data, then try running playback on a different thread. You won't get any frames while playback is occurring, if the main thread is sleeping.

    ~Angela


    Saturday, June 27, 2015 12:22 AM
  • I just posted a basic record/playback sample which shows how to use the APIs, you can find it here: https://github.com/angelaHillier/RecordAndPlaybackBasics-WPF.git
    Tuesday, June 30, 2015 6:23 AM