|
From: Keiko H. <kei...@gm...> - 2007-10-25 05:18:03
|
Hello, I would like to use sox as a library from a C++ program. I have read the man page for libsox, but I don't quite follow the details on how to use an effect using the library functions. A simple example of the kind of thing I would like to do is this: a) Read input file A.wav b) Read input file B.wav c) Concatenate A and B to form C d) Read input file D.wav e) Mix C and D to form E f) Trim the first five seconds off E g) Write E to a file E.mp3 I can see that I need to call sox_format_init(), sox_open_read() to open a file to read, and sox_read() to read the data into a fox_ssample_buf. After that it gets hazy... Let's say I want to concatenate two audio buffers. Do I just call sox_find_effect() to find the "sox_concatenate" effect (is that its name)? How do I specify two (or more) inputs to the concatenation? Can I just call the flow() function for the effect to get it to do its work, or is there a more complicated mechanism for applying an effect? Does anyone know any examples of using Sox as a library in this way? Any help would be greatly appreciated! Thanks, --Keiko |