Skip to content

Instantly share code, notes, and snippets.

View mysteryjeans's full-sized avatar

Faraz M. Khan mysteryjeans

View GitHub Profile
@mysteryjeans
mysteryjeans / Conductor.cc
Created June 1, 2017 16:57
WebRTC Conductor using custom Audio & Video source
#include "audiorenderer.h"
#include "videorenderer.h"
#include "audiocapturemodule.h"
#include "yuvframecapture.h"
#include "conductor.h"
#include "webrtc/api/test/fakeconstraints.h"
#include "webrtc/video_encoder.h"
#include "webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.h"
var bits = 16;
var channels = 1;
var sampleRate = 8000;
var sampleSize = bits / 8 * channels;
var frameSamples = sampleRate / 100; // RTC accepts only 10ms frames so sample rate/1000ms * 10
var duration = 100; // Jitter buffer cache, it should be multiple of 10s
var processDelay = 0;
var renderedTime = 0L;
var syncTime = Stopwatch.StartNew();
@mysteryjeans
mysteryjeans / AudioCaptureModule.cc
Created March 10, 2017 00:22
WebRTC AudioDeviceModule implementation for custom source
/*
* libjingle
* Copyright 2012, Google Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,