gpt4 book ai didi

c - libsox 转换 wav 文件采样率等。

转载 作者:太空宇宙 更新时间:2023-11-04 04:09:34 26 4
gpt4 key购买 nike

编辑:我想使用 libsox 以编程方式转换 wav 文件的采样率、音频格式、 channel 等。

在 libsox 手册页中,有很多我可以使用的函数,但我完全不知道该怎么做。任何人都可以给我一些关于如何做的步骤吗?

帮忙吗?


有人能解释一下吗?

   The  function  sox_write  writes  len samples from buf using the format
handler specified by ft. Data in buf must be 32-bit signed samples and
will be converted during the write process. The value of len is speci-
fied in total samples. If its value is not evenly divisable by the num-
ber of channels, undefined behavior will occur.

最佳答案

我推荐 libsndfile 和 libsamplerate 的组合

http://www.mega-nerd.com/SRC

SRC provides a small set of converters to allow quality to be traded off against computation cost. The current best converter provides a signal-to-noise ratio of 145dB with -3dB passband extending from DC to 96% of the theoretical best bandwidth for a given pair of input and output sample rates.

http://www.mega-nerd.com/libsndfile/

  • Ability to read and write a large number of file formats.
  • A simple, elegant and easy to use Applications Programming Interface.
  • Usable on Unix, Win32, MacOS and others.
  • On the fly format conversion, including endian-ness swapping, type conversion and bitwidth scaling.
  • Optional normalisation when reading floating point data from files containing integer data.
  • Ability to open files in read/write mode.
  • The ability to write the file header without closing the file (only on files open for write or read/write).
  • Ability to query the library about all supported formats and retrieve text strings describing each format.

关于c - libsox 转换 wav 文件采样率等。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/514061/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com