LeapRecorder.SaveToNewFile C# (CSharp) Method

SaveToNewFile() public method

public SaveToNewFile ( string path ) : string
path string
return string
  public string SaveToNewFile(string path) {
    if (File.Exists(@path)) {
      File.Delete(@path);
    }

    FileStream stream = new FileStream(path, FileMode.Append, FileAccess.Write);
    for (int i = 0; i < frames_.Count; ++i) {
      byte[] frame_size = new byte[4];
      frame_size = System.BitConverter.GetBytes(frames_[i].Length);
      stream.Write(frame_size, 0, frame_size.Length);
      stream.Write(frames_[i], 0, frames_[i].Length);
    }

    stream.Close();
    return path;
  }

Same methods

LeapRecorder::SaveToNewFile ( ) : string

Usage Example

Example #1
0
    public string FinishAndSaveRecording()
    {
        string path = recorder_.SaveToNewFile();

        recorder_.Play();
        return(path);
    }
All Usage Examples Of LeapRecorder::SaveToNewFile