public void StartRecording(Container container, VideoFormat videoFormat, AudioFormat audioFormat, RecordingCallback videoCallback) { // Make sure that recording size is even videoFormat = new VideoFormat( videoFormat.width >> 1 << 1, videoFormat.height >> 1 << 1, videoFormat.framerate, videoFormat.bitrate, videoFormat.keyframeInterval ); // Save state this.dispatch = new MainDispatch(); this.videoFormat = videoFormat; this.recordingCallback = videoCallback; // Start recording natcorder.Call("startRecording", (int)container, videoFormat.width, videoFormat.height, videoFormat.framerate, videoFormat.bitrate, videoFormat.keyframeInterval, audioFormat.sampleRate, audioFormat.channelCount ); }
public virtual void StartRecording (Container container, VideoFormat videoFormat, AudioFormat audioFormat, RecordingCallback recordingCallback) { // Make sure that recording size is even videoFormat = new VideoFormat( videoFormat.width >> 1 << 1, videoFormat.height >> 1 << 1, videoFormat.framerate, videoFormat.bitrate, videoFormat.keyframeInterval ); // Save state this.dispatch = new MainDispatch(); this.videoFormat = videoFormat; this.recordingCallback = recordingCallback; this.framebuffer = new Texture2D(videoFormat.width, videoFormat.height, TextureFormat.ARGB32, false); // Start recording NatCorderBridge.StartRecording( container, videoFormat.width, videoFormat.height, videoFormat.framerate, videoFormat.bitrate, videoFormat.keyframeInterval, audioFormat.sampleRate, audioFormat.channelCount ); }
public void StartRecording(RecordingCallback callback) { this.callback = callback; // Create filestream var filename = string.Format("recording_{0}.wav", DateTime.Now.ToString("yyyy_MM_dd_HH_mm_ss_fff")); outputStream = new FileStream(Path.Combine(NatMic.Implementation.RecordingPath, filename), FileMode.Create); // 'Allocate' header const byte @null = new byte(); for (int i = 0; i < 44; i++) { outputStream.WriteByte(@null); } }
public void StartRecording(Container container, VideoFormat videoFormat, AudioFormat audioFormat, RecordingCallback recordingCallback) { }
public static void StartRecording(Container container, VideoFormat videoFormat, AudioFormat audioFormat, RecordingCallback recordingCallback) { if (IsRecording) { Debug.LogError("NatCorder Error: Cannot start recording because NatCorder is already recording"); return; } if (recordingCallback == null) { Debug.LogError("NatCorder Error: Cannot record video without callback"); return; } Implementation.StartRecording(container, videoFormat, audioFormat, recordingCallback); }
public static extern void SetRecordingCallback(uint handle, RecordingCallback callback, int mediaTypes);
public override void StartRecording(Container container, VideoFormat videoFormat, AudioFormat audioFormat, RecordingCallback recordingCallback) { base.StartRecording( container, videoFormat, audioFormat, path => recordingCallback(path.Replace('/', '\\')) ); }