From: Alex Sadleir Date: Wed, 02 Jan 2013 00:05:15 +0000 Subject: select input X-Git-Url: https://maxious.lambdacomplex.org/git/?p=scannr.git&a=commitdiff&h=d45092073c216d17f214015064451a7ea949b2ba --- select input --- --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -9,13 +9,13 @@ - + @@ -37,13 +37,14 @@ - + + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -144,6 +172,7 @@ @@ -151,7 +180,7 @@ @@ -179,6 +208,8 @@ + + @@ -199,15 +230,13 @@ - - - + @@ -220,12 +249,35 @@ + + + + + + + + + @@ -265,21 +317,21 @@ - + - + - + @@ -349,90 +401,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - + + + --- a/generateConvos.php +++ b/generateConvos.php @@ -1,4 +1,5 @@ prepare('select * from recordings limit 100;'); --- /dev/null +++ b/generateHourlys.php @@ -1,1 +1,33 @@ +&1'; + //print_r($hourly); + exec ( $cmd,$output,$returncode ); + echo $cmd."
\n"; + if ($returncode != 10) { + //print_r($output); + //die(); + } + } +} +$sth = $conn->prepare("select tgid, extract(hour from call_timestamp) ahour, date_trunc('day', call_timestamp) aday, count(filename), array_to_string(array_agg(filename order by call_timestamp), ',') filenames from recordings group by tgid, ahour, aday order by aday DESC, ahour, tgid;"); + +$sth->execute(); +$hourlies = $sth->fetchAll(PDO::FETCH_ASSOC); +foreach($hourlies as $hourly) { + //processHourly($hourly); +} +$sth = $conn->prepare("select 'hour' as tgid, extract(hour from call_timestamp) ahour, date_trunc('day', call_timestamp) aday, count(filename), array_to_string(array_agg(filename order by call_timestamp), ',') filenames from recordings group by ahour, aday order by aday DESC, ahour;"); + +$sth->execute(); +$hourlies = $sth->fetchAll(PDO::FETCH_ASSOC); +foreach($hourlies as $hourly) { + processHourly($hourly); +} + --- a/test.py +++ b/test.py @@ -11,11 +11,17 @@ WAVE_OUTPUT_FILENAME = "output.wav" p = pyaudio.PyAudio() - +device_idx = 0; +for i in range (0, p.get_device_count()): + print(p.get_device_info_by_index(i)) + if p.get_device_info_by_index(i)['name'] == 'Built-in Input': + device_idx = i + print i stream = p.open(format=FORMAT, channels=CHANNELS, rate=RATE, input=True, + input_device_index=device_idx, frames_per_buffer=CHUNK) print("* recording")