LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

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

Rep: Reputation: 0
Smile 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
 
Old 08-12-2009, 12:34 AM   #2
paulsm4
Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
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
 
  


Reply

Tags
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


All times are GMT -5. The time now is 07:25 PM.

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