[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sox-users
Subject:    Re: [SoX-users] Question about reducing a channel from wav programmaticaly?
From:       William Mortimore <wm () keystoneinsights ! com>
Date:       2011-11-06 18:16:50
Message-ID: 32788692.post () talk ! nabble ! com
[Download RAW message or body]


Did you ever get a response to this post. I recently posted the same
question/problem and have gotten no answer yet.


xldelg wrote:
> 
> hi,
> 
> I'm new to libsox programming, and I want to reduce a chennel from a
> stereo audio which named 'a.wav' then generate a mono audio 'b.wav' with
> the following code:
> ------------------------------------------------------------------------------------------------------------
>  sox_format_t * in, * out; 
> sox_effects_chain_t * chain;
> sox_effect_t * e;
> char * args[10];
> 
> sox_init();
> in = sox_open_read("E:\\a.wav", NULL, NULL, NULL);
> out = sox_open_write("E:\\b.wav", &in->signal, NULL, NULL, NULL, NULL);
> out->signal.channels = 1;
> 
> chain = sox_create_effects_chain(&in->encoding, &out->encoding);
> e = sox_create_effect(sox_find_effect("input"));
> sox_add_effect(chain, e, &in->signal, &in->signal);
> 
> e = sox_create_effect(sox_find_effect("channels"));
> sox_add_effect(chain, e, &in->signal, &out->signal);
> 
> e = sox_create_effect(sox_find_effect("output"));
> sox_add_effect(chain, e, &in->signal, &out->signal);
> 
> sox_flow_effects(chain, NULL, NULL);
> sox_delete_effects_chain(chain);
> sox_close(out);
> sox_close(in);
> sox_format_quit();
> -----------------------------------------------------------------------------------------------------------
>  After running the application, the mono audio 'b.wav' was generated, but
> the duration of the sound was half of the a.wav.
> Is there something wrong with my code?
> 
> Any reply will be appreciated!
> 
> 2009-12-01 
> 
> 
> 
> John
> 
> ------------------------------------------------------------------------------
> Join us December 9, 2009 for the Red Hat Virtual Experience,
> a free event focused on virtualization and cloud computing. 
> Attend in-depth sessions from your desk. Your couch. Anywhere.
> http://p.sf.net/sfu/redhat-sfdev2dev
> _______________________________________________
> Sox-users mailing list
> Sox-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sox-users
> 
> 

-- 
View this message in context: \
http://old.nabble.com/Question-about-reducing-a-channel-from-wav-programmaticaly--tp26589048p32788692.html
 Sent from the SoX mailing list archive at Nabble.com.


------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic