libsox

Increasing channel using libsox

梦想的初衷 提交于 2020-01-25 06:51:08
问题 I am trying to use libsox to increase the channel of a wav file. I have read the related question: Reducing a channel from wav file using libsox I also read the libsox's exampl3.c. I take a deep copy of in->signal as interm_signal. But the resulting file is still half the duration of the original file. Here is my code: int main(int argc, char * argv[]) { sox_format_t *input = NULL; sox_format_t *output = NULL; sox_effects_chain_t *chain = NULL; sox_effect_t *e = NULL; char * args[10]; assert

Downsampling a wav file using libsox

爱⌒轻易说出口 提交于 2019-12-10 17:44:05
问题 I'm trying to convert a 16KHZ 16-bit Signed PCM encoded wave file to 8KHz 8-bit mu-encoded wav file using the Sox library C program (http://sox.sourceforge.net/). The conversion from PCM to mu is working fine. But when I apply the down-sampling effect the output file duration is just half of the i/p file(see below). I used the technique mentioned in the post How to change the samples rates when do the format conversion by sox C libraries? but it didn't help me. When I execute the below code I