LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   adding samples from one PCM file into another (https://www.linuxquestions.org/questions/programming-9/adding-samples-from-one-pcm-file-into-another-746660/)

ryancuomo 08-11-2009 03:47 AM

adding samples from one PCM file into another
 
Hello,

I'm looking for any help regarding adding samples of one audio file to another in C++. I've made an algorithm which mixes two arrays together at a specified index, however I'm trying to work out how to get the samples from the stage:

ifstream fileOne ("One.wav", ios::in|ios::binary);
ifstream fileTwo ("Two.wav", ios::in|ios::binary);

...to the point when I mix the arrays together. Any help would be highly appreciated.

Cheers,
Ryan

paulsm4 08-12-2009 12:34 AM

Hi -

You've got tons of choices:

http://linux-sound.org/tools.html

However, you might be better off finding an open source audio environment you like (rather than limiting your search to libraries that happen to support C++ - which isn't necessarily the best choice for a lot of things you might like to do). For example, maybe you'll find a sound editing program ... that's best used with its own scripting language. Or Perl, or Python (instead of C or C++).

Similarly, I get this impression your "algorithm" might be tied to C/C++ implementation details (for example, when you say "arrays", I'm guessing you might literally mean "c/C++ arrays of data"). You might well find that one or another library pretty much forces you to use it's own data structures - and you might also find this works out *better* for your end-goal (implementing your ideas in code, and listening to the results)!

Anyway - there are *lots* of choices. Experiment, keep an open mind ... and see what works best for you!

IMHO .. PSM


All times are GMT -5. The time now is 02:06 PM.