我正在尝试将 wav 文件转换为 TETRA 编码文件( https://en.wikipedia.org/wiki/Terrestrial_Trunked_Radio )。 Tetra 被消防员使用,它提供类似 radio 的声音。
我正在尝试使用 (https://www.etsi.org/deliver/etsi_en/300300_300399/30039502/01.03.01_60/) 提供的官方 tetra 编解码器代码,我们可以使用 https://github.com/sq5bpf/install-tetra-codec 提供的脚本轻松编译它.
但是,我无法弄清楚如何使用这些文件将 wav 文件转换为 tetra 编解码器文件。我尝试浏览已编译文件(ccoder、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
是实际编码数据,您可以在解码器中使用它。
传统上,ETSI 代码使用非常低效的输出格式,而不是位,它们输出这些位的文本或扩展表示。 IE。他们写了一个 16 位的字,而不是一个位,其中所有位都是 0,最后一位有信息。他们这样做是为了与我认为的传输损坏测试工具进行交互。
所以串行文件的实际长度应该小 16 倍,所以你将 13Mb 转换为 0.5Mb 就可以了。
关于ffmpeg - 将 WAV 转换为 TETRA 格式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62364493/