blob: 9c01e66390a8970146ef9c32eb0bc4697911db77 [file] [log] [blame]
Roman Khassraf2b1ebf12015-08-29 17:43:43 +02001#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3# @file
Piotr Krysika6268a52017-08-23 16:02:19 +02004# @author (C) 2015 by Roman Khassraf <rkhassraf@gmail.com>
Roman Khassraf2b1ebf12015-08-29 17:43:43 +02005# @section LICENSE
6#
7# Gr-gsm is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 3, or (at your option)
10# any later version.
11#
12# Gr-gsm is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with gr-gsm; see the file COPYING. If not, write to
19# the Free Software Foundation, Inc., 51 Franklin Street,
20# Boston, MA 02110-1301, USA.
21#
22#
23
24from gnuradio import blocks
25from gnuradio import eng_notation
26from gnuradio import gr
27from gnuradio.eng_option import eng_option
28from optparse import OptionParser, OptionGroup
29import collections
30import grgsm
Roman Khassraf262b53d2015-09-13 12:14:26 +020031import pmt
Roman Khassraf2b1ebf12015-08-29 17:43:43 +020032import socket
33
34
Piotr Krysik3e192c42016-02-13 07:31:51 +010035class grgsm_decoder(gr.top_block):
Roman Khassraf2b1ebf12015-08-29 17:43:43 +020036
37 def __init__(self, timeslot=0, subslot=None, chan_mode='BCCH',
38 burst_file=None,
Piotr Krysik231aca72016-07-17 10:44:43 +020039 cfile=None, fc=None, samp_rate=2e6,
Roman Khassraf2b1ebf12015-08-29 17:43:43 +020040 a5=1, a5_kc=None,
Roman Khassraf262b53d2015-09-13 12:14:26 +020041 speech_file=None, speech_codec=None,
Roman Khassrafc0addfb2016-09-27 20:11:42 +020042 enable_voice_boundary_detection=False,
Piotr Krysik0679ceb2016-04-29 11:16:22 +020043 verbose=False,
Piotr Krysik231aca72016-07-17 10:44:43 +020044 print_bursts=False, ppm=0):
Roman Khassraf2b1ebf12015-08-29 17:43:43 +020045
Piotr Krysik3e192c42016-02-13 07:31:51 +010046 gr.top_block.__init__(self, "Gr-gsm Decode")
Roman Khassraf2b1ebf12015-08-29 17:43:43 +020047
48 ##################################################
49 # Parameters
50 ##################################################
51 self.timeslot = timeslot
52 self.subslot = subslot
53 self.chan_mode = chan_mode
54 self.burst_file = burst_file
55 self.cfile = cfile
56 self.fc = fc
57 self.samp_rate = samp_rate
Roman Khassraf2b1ebf12015-08-29 17:43:43 +020058 self.a5 = a5
59 self.kc = a5_kc
60 if len(a5_kc) < 8:
61 self.kc = [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]
62 self.speech_file = speech_file
63 self.speech_codec = speech_codec
Roman Khassraf262b53d2015-09-13 12:14:26 +020064 self.verbose = verbose
Piotr Krysik0679ceb2016-04-29 11:16:22 +020065 self.print_bursts = print_bursts
Roman Khassrafc0addfb2016-09-27 20:11:42 +020066 self.enable_voice_boundary_detection = enable_voice_boundary_detection
Roman Khassraf2b1ebf12015-08-29 17:43:43 +020067
68 ##################################################
69 # Blocks
70 ##################################################
71
72 if self.burst_file:
73 self.burst_file_source = grgsm.burst_file_source(burst_file)
74 elif self.cfile:
75 self.file_source = blocks.file_source(gr.sizeof_gr_complex*1, self.cfile, False)
76 self.receiver = grgsm.receiver(4, ([0]), ([]))
Piotr Krysik8040e012016-03-08 21:42:11 +010077 if self.fc is not None:
Piotr Krysik231aca72016-07-17 10:44:43 +020078 self.input_adapter = grgsm.gsm_input(ppm=ppm, osr=4, fc=self.fc, samp_rate_in=samp_rate)
Piotr Krysik388bc0d2016-07-15 14:17:05 +020079 self.offset_control = grgsm.clock_offset_control(self.fc, self.samp_rate)
Piotr Krysik8040e012016-03-08 21:42:11 +010080 else:
Piotr Krysik231aca72016-07-17 10:44:43 +020081 self.input_adapter = grgsm.gsm_input(ppm=ppm, osr=4, samp_rate_in=samp_rate)
Roman Khassraf2b1ebf12015-08-29 17:43:43 +020082
83 self.dummy_burst_filter = grgsm.dummy_burst_filter()
84 self.timeslot_filter = grgsm.burst_timeslot_filter(self.timeslot)
85
86 self.subslot_filter = None
87 if self.chan_mode == 'BCCH_SDCCH4' and self.subslot is not None:
88 self.subslot_filter = grgsm.burst_sdcch_subslot_filter(grgsm.SS_FILTER_SDCCH4, self.subslot)
89 elif self.chan_mode == 'SDCCH8' and self.subslot is not None:
90 self.subslot_filter = grgsm.burst_sdcch_subslot_filter(grgsm.SS_FILTER_SDCCH8, self.subslot)
91
92 if self.chan_mode == 'BCCH':
Piotr Krysik773a1942016-05-20 12:45:54 +020093 self.bcch_demapper = grgsm.gsm_bcch_ccch_demapper(self.timeslot)
Roman Khassraf2b1ebf12015-08-29 17:43:43 +020094 elif self.chan_mode == 'BCCH_SDCCH4':
Piotr Krysik773a1942016-05-20 12:45:54 +020095 self.bcch_sdcch4_demapper = grgsm.gsm_bcch_ccch_sdcch4_demapper(self.timeslot)
Roman Khassraf2b1ebf12015-08-29 17:43:43 +020096 elif self.chan_mode == 'SDCCH8':
Piotr Krysik773a1942016-05-20 12:45:54 +020097 self.sdcch8_demapper = grgsm.gsm_sdcch8_demapper(self.timeslot)
Roman Khassraf2b1ebf12015-08-29 17:43:43 +020098 elif self.chan_mode == 'TCHF':
99 self.tch_f_demapper = grgsm.tch_f_chans_demapper(self.timeslot)
Roman Khassrafc0addfb2016-09-27 20:11:42 +0200100 self.tch_f_decoder = grgsm.tch_f_decoder(speech_codec, enable_voice_boundary_detection)
Piotr Krysik27791722016-07-20 08:12:23 +0200101 self.tch_f_pdu_to_tagged_stream = blocks.pdu_to_tagged_stream(blocks.byte_t, "packet_len")
102 self.tch_f_file_sink = blocks.file_sink(gr.sizeof_char*1, speech_file, False)
Roman Khassraf2b1ebf12015-08-29 17:43:43 +0200103
104 if self.kc != [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]:
105 self.decryption = grgsm.decryption(self.kc, self.a5)
106 self.cch_decoder_decrypted = grgsm.control_channels_decoder()
107 if self.chan_mode == 'TCHF':
108 self.decryption_tch_sacch = grgsm.decryption(self.kc, self.a5)
109
110 self.cch_decoder = grgsm.control_channels_decoder()
111
Piotr Krysikbeb36f42016-06-09 13:58:52 +0200112 self.socket_pdu_server = blocks.socket_pdu("UDP_SERVER", "127.0.0.1", "4729", 10000) #added in order to avoid generating ICMP messages
Piotr Krysik72a16172016-02-22 14:30:02 +0100113 self.socket_pdu = blocks.socket_pdu("UDP_CLIENT", "127.0.0.1", "4729", 10000)
Piotr Krysikbeb36f42016-06-09 13:58:52 +0200114
Roman Khassraf262b53d2015-09-13 12:14:26 +0200115 if self.verbose:
116 self.message_printer = grgsm.message_printer(pmt.intern(""), True, True, False)
117
Piotr Krysik0679ceb2016-04-29 11:16:22 +0200118 if self.print_bursts:
Piotr Krysik7685bc02016-04-29 12:09:01 +0200119 self.bursts_printer = grgsm.bursts_printer(pmt.intern(""), True, True, True, True)
Piotr Krysik0679ceb2016-04-29 11:16:22 +0200120
121
Roman Khassraf2b1ebf12015-08-29 17:43:43 +0200122
123 ##################################################
124 # Asynch Message Connections
125 ##################################################
126
127 if self.burst_file:
128 self.msg_connect(self.burst_file_source, "out", self.dummy_burst_filter, "in")
129 elif self.cfile:
130 self.connect((self.file_source, 0), (self.input_adapter, 0))
131 self.connect((self.input_adapter, 0), (self.receiver, 0))
Piotr Krysik8040e012016-03-08 21:42:11 +0100132 if self.fc is not None:
Piotr Krysik6577ec22016-07-15 13:21:09 +0200133 self.msg_connect(self.offset_control, "ctrl", self.input_adapter, "ctrl_in")
Piotr Krysik8040e012016-03-08 21:42:11 +0100134 self.msg_connect(self.receiver, "measurements", self.offset_control, "measurements")
Roman Khassraf2b1ebf12015-08-29 17:43:43 +0200135 self.msg_connect(self.receiver, "C0", self.dummy_burst_filter, "in")
136
137 self.msg_connect(self.dummy_burst_filter, "out", self.timeslot_filter, "in")
Piotr Krysik0679ceb2016-04-29 11:16:22 +0200138 if self.print_bursts:
139 self.msg_connect(self.timeslot_filter, "out", self.bursts_printer, 'bursts')
Roman Khassraf2b1ebf12015-08-29 17:43:43 +0200140
141 if (self.chan_mode == 'BCCH_SDCCH4' or self.chan_mode == 'SDCCH8') and self.subslot_filter is not None:
142 self.msg_connect(self.timeslot_filter, "out", self.subslot_filter, "in")
143
144 if self.chan_mode == 'BCCH':
145 if self.subslot_filter is not None:
146 self.msg_connect(self.subslot_filter, "out", self.bcch_demapper, "bursts")
147 else:
148 self.msg_connect(self.timeslot_filter, "out", self.bcch_demapper, "bursts")
149
150 self.msg_connect(self.bcch_demapper, "bursts", self.cch_decoder, "bursts")
151 self.msg_connect(self.cch_decoder, "msgs", self.socket_pdu, "pdus")
Roman Khassraf262b53d2015-09-13 12:14:26 +0200152 if self.verbose:
153 self.msg_connect(self.cch_decoder, "msgs", self.message_printer, "msgs")
Roman Khassraf2b1ebf12015-08-29 17:43:43 +0200154
155 elif self.chan_mode == 'BCCH_SDCCH4':
156 if self.subslot_filter is not None:
157 self.msg_connect(self.subslot_filter, "out", self.bcch_sdcch4_demapper, "bursts")
158 else:
159 self.msg_connect(self.timeslot_filter, "out", self.bcch_sdcch4_demapper, "bursts")
160
161 if self.kc != [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]:
162 self.msg_connect(self.bcch_sdcch4_demapper, "bursts", self.decryption, "bursts")
163 self.msg_connect(self.decryption, "bursts", self.cch_decoder_decrypted, "bursts")
164 self.msg_connect(self.cch_decoder_decrypted, "msgs", self.socket_pdu, "pdus")
Roman Khassraf262b53d2015-09-13 12:14:26 +0200165 if self.verbose:
166 self.msg_connect(self.cch_decoder_decrypted, "msgs", self.message_printer, "msgs")
Roman Khassraf2b1ebf12015-08-29 17:43:43 +0200167
168 self.msg_connect(self.bcch_sdcch4_demapper, "bursts", self.cch_decoder, "bursts")
169 self.msg_connect(self.cch_decoder, "msgs", self.socket_pdu, "pdus")
Roman Khassraf262b53d2015-09-13 12:14:26 +0200170 if self.verbose:
171 self.msg_connect(self.cch_decoder, "msgs", self.message_printer, "msgs")
Roman Khassraf2b1ebf12015-08-29 17:43:43 +0200172
173 elif self.chan_mode == 'SDCCH8':
174 if self.subslot_filter is not None:
175 self.msg_connect(self.subslot_filter, "out", self.sdcch8_demapper, "bursts")
176 else:
177 self.msg_connect(self.timeslot_filter, "out", self.sdcch8_demapper, "bursts")
178
179 if self.kc != [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]:
180 self.msg_connect(self.sdcch8_demapper, "bursts", self.decryption, "bursts")
181 self.msg_connect(self.decryption, "bursts", self.cch_decoder_decrypted, "bursts")
182 self.msg_connect(self.cch_decoder_decrypted, "msgs", self.socket_pdu, "pdus")
Roman Khassraf262b53d2015-09-13 12:14:26 +0200183 if self.verbose:
184 self.msg_connect(self.cch_decoder_decrypted, "msgs", self.message_printer, "msgs")
Roman Khassraf2b1ebf12015-08-29 17:43:43 +0200185
186 self.msg_connect(self.sdcch8_demapper, "bursts", self.cch_decoder, "bursts")
187 self.msg_connect(self.cch_decoder, "msgs", self.socket_pdu, "pdus")
Roman Khassraf262b53d2015-09-13 12:14:26 +0200188 if self.verbose:
189 self.msg_connect(self.cch_decoder, "msgs", self.message_printer, "msgs")
Roman Khassraf2b1ebf12015-08-29 17:43:43 +0200190
191 elif self.chan_mode == 'TCHF':
192 self.msg_connect(self.timeslot_filter, "out", self.tch_f_demapper, "bursts")
193 if self.kc != [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]:
194 self.msg_connect(self.tch_f_demapper, "acch_bursts", self.decryption_tch_sacch, "bursts")
195 self.msg_connect(self.tch_f_demapper, "tch_bursts", self.decryption, "bursts")
196
197 self.msg_connect(self.decryption_tch_sacch, "bursts", self.cch_decoder, "bursts")
198 self.msg_connect(self.decryption, "bursts", self.tch_f_decoder, "bursts")
199 else:
200 self.msg_connect(self.tch_f_demapper, "acch_bursts", self.cch_decoder, "bursts")
201 self.msg_connect(self.tch_f_demapper, "tch_bursts", self.tch_f_decoder, "bursts")
202
203 self.msg_connect(self.tch_f_decoder, "msgs", self.socket_pdu, "pdus")
204 self.msg_connect(self.cch_decoder, "msgs", self.socket_pdu, "pdus")
Piotr Krysik27791722016-07-20 08:12:23 +0200205 self.msg_connect(self.tch_f_decoder, "voice", self.tch_f_pdu_to_tagged_stream, "pdus")
206 self.connect((self.tch_f_pdu_to_tagged_stream, 0), (self.tch_f_file_sink, 0))
207
208
Roman Khassraf262b53d2015-09-13 12:14:26 +0200209 if self.verbose:
210 self.msg_connect(self.tch_f_decoder, "msgs", self.message_printer, "msgs")
211 self.msg_connect(self.cch_decoder, "msgs", self.message_printer, "msgs")
Roman Khassraf2b1ebf12015-08-29 17:43:43 +0200212
213
214if __name__ == '__main__':
215
216 # List of channel configurations
217 channel_modes = ['BCCH', 'BCCH_SDCCH4', 'SDCCH8', 'TCHF']
218
219 # mapping options to grgsm's enums
220 tch_codecs = collections.OrderedDict([
221 ('FR', grgsm.TCH_FS),
222 ('EFR', grgsm.TCH_EFR),
223 ('AMR12.2', grgsm.TCH_AFS12_2),
224 ('AMR10.2', grgsm.TCH_AFS10_2),
225 ('AMR7.95', grgsm.TCH_AFS7_95),
226 ('AMR7.4', grgsm.TCH_AFS7_4),
227 ('AMR6.7', grgsm.TCH_AFS6_7),
228 ('AMR5.9', grgsm.TCH_AFS5_9),
229 ('AMR5.15', grgsm.TCH_AFS5_15),
230 ('AMR4.75', grgsm.TCH_AFS4_75)
231 ])
232
233 kc = []
234
235 parser = OptionParser(option_class=eng_option, usage="%prog: [options]")
236
237 def kc_callback(option, opt_str, value, parser):
238
239 """ Callback function that parses Kc """
240
241 # format 0x12,0x34,0x56,0x78,0x90,0xAB,0xCD,0xEF
242 if ',' in value:
243 value_str = value.split(',')
244
245 for s in value_str:
246 val = int(s, 16)
247 if val < 0 or val > 255:
248 parser.error("Invalid Kc % s\n" % s)
249 kc.append(val)
250 if len(kc) != 8:
251 parser.error("Invalid Kc length")
252 # format: 1234567890ABCDEF
253 elif len(value) == 16:
254 for i in range(8):
255 s = value[2*i: 2*i + 2]
256 val = int(s, 16)
257 if val < 0 or val > 255:
258 parser.error("Invalid Kc % s\n" % s)
259 kc.append(val)
260 else:
261 parser.error("Invalid Kc format")
262
263 # define options
264 parser.add_option("-m", "--mode", dest="chan_mode", default='BCCH',
265 type='choice', choices=channel_modes,
266 help="Channel mode. Valid options are 'BCCH' (Non-combined C0), "
267 "'BCCH_SDCCH4'(Combined C0), 'SDCCH8' (Stand-alone control channel) "
268 "and 'TCHF' (Traffic Channel, Full rate) ")
269 parser.add_option("-t", "--timeslot", dest="timeslot", type="intx", default=0,
270 help="Timeslot to decode [default=%default]")
271 parser.add_option("-u", "--subslot", dest="subslot", type="intx",
272 help="Subslot to decode. Use in combination with channel type BCCH_SDCCH4 and SDCCH8")
273 parser.add_option("-b", "--burst-file", dest="burst_file", help="Input file (bursts)")
274 parser.add_option("-c", "--cfile", dest="cfile", help="Input file (cfile)")
Roman Khassraf262b53d2015-09-13 12:14:26 +0200275 parser.add_option("-v", "--verbose", action="store_true",
276 help="If set, the decoded messages (with frame number and count) are printed to stdout")
Piotr Krysik0679ceb2016-04-29 11:16:22 +0200277 parser.add_option("-p", "--print-bursts", action="store_true",
278 help="If set, the raw bursts (with frame number and count) are printed to stdout")
Roman Khassraf2b1ebf12015-08-29 17:43:43 +0200279
280 # group cfile options together
281 cfile_options = OptionGroup(
282 parser, 'Cfile Options', 'Options for decoding cfile input.',
283 )
284 cfile_options.add_option("-f", "--fc", dest="fc", type="eng_float",
Piotr Krysik231aca72016-07-17 10:44:43 +0200285 help="Frequency of cfile capture")
Roman Khassraf2b1ebf12015-08-29 17:43:43 +0200286 cfile_options.add_option("-a", "--arfcn", dest="arfcn", type="intx",
Piotr Krysikfcb45b02017-09-11 10:07:25 +0200287 help="Set ARFCN instead of frequency (for PCS1900 add 0x8000 (2**15) to the ARFCN number).")
Roman Khassraf2b1ebf12015-08-29 17:43:43 +0200288 cfile_options.add_option("-s", "--samp-rate", dest="samp_rate", type="eng_float",
Piotr Krysik13d9e7a2016-04-24 15:23:15 +0200289 default=eng_notation.num_to_str(1e6),
Roman Khassraf2b1ebf12015-08-29 17:43:43 +0200290 help="Sample rate of cfile capture [default=%default]")
Piotr Krysik231aca72016-07-17 10:44:43 +0200291 cfile_options.add_option("--ppm", dest="ppm", type="float", default=0,
292 help="Set frequency offset correction [default=%default]")
293
Roman Khassraf2b1ebf12015-08-29 17:43:43 +0200294 parser.add_option_group(cfile_options)
295
296 # group decryption options
297 decryption_options = OptionGroup(
298 parser, 'Decryption Options', 'Options for setting the A5 decryption parameters.',
299 )
300 decryption_options.add_option("-e", "--a5", dest="a5", type="intx", default=1,
301 help="A5 version [default=%default]. A5 versions 1 - 3 supported")
302 decryption_options.add_option("-k", "--kc", action="callback", callback=kc_callback, type="string",
303 help="A5 session key Kc. Valid formats are "
304 "'0x12,0x34,0x56,0x78,0x90,0xAB,0xCD,0xEF' and '1234567890ABCDEF'")
305 parser.add_option_group(decryption_options)
306
307 # group TCH options
308 tch_options = OptionGroup(
309 parser, 'TCH Options', 'Options for setting Traffic channel decoding parameters.',
310 )
311 tch_options.add_option("-d", "--speech-codec", dest="speech_codec", default='FR',
312 type='choice', choices=tch_codecs.keys(),
313 help="TCH-F speech codec [default=%default]. "
314 "Valid options are " + ", ".join(tch_codecs.keys()))
315 tch_options.add_option("-o", "--output-tch", dest="speech_output_file", default="/tmp/speech.au.gsm",
316 help="TCH/F speech output file [default=%default].")
Piotr Krysik2770fc42017-07-23 22:05:10 +0200317 tch_options.add_option("--voice-boundary", dest="enable_voice_boundary_detection", action="store_true", default=False,
Roman Khassrafc0addfb2016-09-27 20:11:42 +0200318 help="Enable voice boundary detection for traffic channels. This can help reduce noice in the output.")
Roman Khassraf2b1ebf12015-08-29 17:43:43 +0200319 parser.add_option_group(tch_options)
320
321 # parse
322 (options, args) = parser.parse_args()
323
324 # some verifications
325 if (options.cfile is None and options.burst_file is None) or \
326 (options.cfile is not None and options.burst_file is not None):
327 parser.error("Please provide a cfile or a burst file (but not both) as input\n")
328
329 if options.timeslot < 0 or options.timeslot > 7:
330 parser.error("Invalid timeslot. Must be a in range 0-7\n")
331
332 if options.subslot is not None and (options.subslot < 0 or options.subslot > 7):
333 parser.error("Invalid subslot. Must be a in range 0-7\n")
334
335 if options.a5 < 0 or options.a5 > 3:
336 parser.error("Invalid A5 version\n")
337
Piotr Krysik231aca72016-07-17 10:44:43 +0200338 if options.cfile and (options.fc is None and options.arfcn is None):
Piotr Krysik8040e012016-03-08 21:42:11 +0100339 print("You haven't provided a frequency or an ARFCN - working without automatic frequency offset correction.\n")
Roman Khassraf2b1ebf12015-08-29 17:43:43 +0200340
341 # handle frequency / arfcn input
Piotr Krysik231aca72016-07-17 10:44:43 +0200342 arfcn = None
343 fc = None
Roman Khassraf2b1ebf12015-08-29 17:43:43 +0200344 if options.arfcn:
Piotr Krysikfcb45b02017-09-11 10:07:25 +0200345 if not grgsm.arfcn.is_valid_arfcn(options.arfcn):
346 parser.error("ARFCN is not valid\n")
Roman Khassraf2b1ebf12015-08-29 17:43:43 +0200347 else:
348 arfcn = options.arfcn
Piotr Krysikfcb45b02017-09-11 10:07:25 +0200349 fc = grgsm.arfcn.arfcn2downlink(arfcn)
Roman Khassraf2b1ebf12015-08-29 17:43:43 +0200350 elif options.fc:
351 fc = options.fc
Piotr Krysikfcb45b02017-09-11 10:07:25 +0200352 arfcn = grgsm.arfcn.downlink2arfcn(options.fc)
Roman Khassraf2b1ebf12015-08-29 17:43:43 +0200353
Roman Khassraf2b1ebf12015-08-29 17:43:43 +0200354 # instanciate decoder
Piotr Krysik3e192c42016-02-13 07:31:51 +0100355 tb = grgsm_decoder(timeslot=options.timeslot, subslot=options.subslot, chan_mode=options.chan_mode,
Roman Khassraf2b1ebf12015-08-29 17:43:43 +0200356 burst_file=options.burst_file,
Piotr Krysik8040e012016-03-08 21:42:11 +0100357 cfile=options.cfile, fc=fc, samp_rate=options.samp_rate,
Roman Khassraf2b1ebf12015-08-29 17:43:43 +0200358 a5=options.a5, a5_kc=kc,
Roman Khassraf262b53d2015-09-13 12:14:26 +0200359 speech_file=options.speech_output_file, speech_codec=tch_codecs.get(options.speech_codec),
Roman Khassrafc0addfb2016-09-27 20:11:42 +0200360 enable_voice_boundary_detection=options.enable_voice_boundary_detection,
Piotr Krysik0679ceb2016-04-29 11:16:22 +0200361 verbose=options.verbose,
Piotr Krysik196982b2016-07-17 10:43:00 +0200362 print_bursts=options.print_bursts, ppm=options.ppm)
Roman Khassraf2b1ebf12015-08-29 17:43:43 +0200363
364 # run
365 tb.start()
366 tb.wait()