This commit is contained in:
Daniil Gentili 2017-06-26 17:34:59 +02:00
parent 8cb6100bac
commit 58d84020f1
3 changed files with 18 additions and 5 deletions

BIN
output.raw Normal file

Binary file not shown.

View File

@ -527,7 +527,7 @@ class MTProto extends \Volatile
'allow_p2p' => false, // Should I accept p2p calls? 'allow_p2p' => false, // Should I accept p2p calls?
'incoming_callback' => 'default_incoming_call_callback', 'incoming_callback' => 'default_incoming_call_callback',
'network_type' => 7, 'network_type' => 7,
'log_file_path' => '/dev/stdout', 'log_file_path' => '/tmp/logs,txt',
'stats_dump_file_path' => '/dev/stdout', 'stats_dump_file_path' => '/dev/stdout',
], ],
'threading' => [ 'threading' => [

View File

@ -97,12 +97,25 @@ trait AuthKeyHandler
$this->calls[$params['id']]['controller']->setRemoteEndpoints(array_merge([$res['connection']], $res['alternative_connections']), $this->settings['calls']['allow_p2p']); $this->calls[$params['id']]['controller']->setRemoteEndpoints(array_merge([$res['connection']], $res['alternative_connections']), $this->settings['calls']['allow_p2p']);
var_dump('start'); var_dump('start');
$this->calls[$params['id']]['controller']->start(); $this->calls[$params['id']]['controller']->start();
readline();
$samplerate = 48000;
$period = 1/$samplerate;
$writePeriod = $period*960;
var_dump($writePeriod);
var_dump('SENDING DAT'); var_dump('SENDING DAT');
$f = fopen('output.raw', 'r'); $f = fopen('output.raw', 'r');
$time = microtime(true);
while (!feof($f)) { while (!feof($f)) {
var_dump('SENDING 960 frames'); usleep(
$this->calls[$params['id']]['controller']->writeFrames(stream_get_contents($f, 960 * 2)); ($writePeriod -
($time - microtime(true)) // Time it took me to write frames
)*1000000
);
var_dump(($writePeriod -
($time - microtime(true)) // Time it took me to write frames
)*1000000);
$time = microtime(true);
$this->calls[$params['id']]['controller']->writeFrames(stream_get_contents($f, 960));
} }
$this->handle_pending_updates(); $this->handle_pending_updates();