我正在尝试将WAV文件转换为TETRA编码文件(https://en.wikipedia.org/wiki/Terrestrial_Trunked_Radio)。 Tetra供消防员使用,它提供类似无线电的声音。
我正在尝试使用(https://www.etsi.org/deliver/etsi_en/300300_300399/30039502/01.03.01_60/)上提供的官方四编解码器代码,我们可以使用https://github.com/sq5bpf/install-tetra-codec上的脚本轻松地对其进行编译。
但是,我无法弄清楚如何使用这些文件将wav文件转换为四编解码器文件。我尝试遍历已编译文件(编码器,cdecoder,scoder,sdecoder)的文档。
我尝试了以下命令-
tetra / bin / scoder input.wav serial_file synth_file
这里serial_file和synth_file是输出文件,并且在scoder.c文件中具有以下文档:
INPUT : - Description : speech file to be analyzed
- Format : binary file 16 bit-samples
240 samples per frame
serial_file : - Description : serial stream output file
- Format : binary file 16 bit-samples
each 16 bit-sample represents one encoded bit
138 (= 1 + 137) bits per frame
synth_file : - Description : local synthesis output file
- Format : binary file 16 bit-samples
对于大小为13M的输入文件,我获得了大小为8.0M和16M的serial_file和synth_file。但是,我认为,由于将wav文件转换为对讲机类型的信号,因此输出文件的大小会小很多。
我想澄清是否:
谢谢,灰
synth_file
是一个内部计算参数,您可以忽略它。
[serial_file
是实际的编码数据,您可以在sdecoder中使用它。
传统上,ETSI代码使用非常无效的输出格式,在这些格式中,它们代替比特输出文本或这些比特的扩展表示。即他们写的不是16位字,而是所有位均为0,最后一位具有信息的16位字。他们这样做是为了与我认为的传输破坏测试工具进行交互。
因此,串行文件的实际长度应该小16倍,所以您将13Mb转换为0.5Mb,就可以了。