Share your knowledge at the LQ Wiki.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 08-11-2009, 03:47 AM   #1
LQ Newbie
Registered: Aug 2009
Posts: 1

Rep: Reputation: 0
Smile adding samples from one PCM file into another


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); the point when I mix the arrays together. Any help would be highly appreciated.

Old 08-12-2009, 12:34 AM   #2
LQ Guru
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

You've got tons of choices:

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!



c++, wav, wave

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
(Sound) what is PCM? what's the difference between PCM volume and master volume? snr8fl3 Linux - General 2 01-27-2009 06:12 AM
audio samples in linux tigerhp Linux - General 2 02-29-2008 12:20 PM
Music samples jrdioko Linux - Newbie 4 07-25-2004 05:54 PM
books about kernel with samples, better way beep_beep Linux - Newbie 1 06-09-2004 09:41 AM
MySQL tips and samples mchirico Linux - Newbie 0 04-16-2004 05:56 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:53 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration