Thread: mixing two wav files n volume

  1. #1
    Registered User
    Join Date
    Jul 2004
    Posts
    2

    mixing two wav files n volume

    hi everyone
    could anyone plz show me how to mix two PCM wavs into one n also how to change the volume levels of them.
    thanx

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    http://www.wotsit.org/
    Get the file format you're interested in
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Jul 2004
    Posts
    2
    i know the format man but i need the logic to mix two wav files n to change the volume of the wav files. help me out plz coz i got a deadline with 3 projects on my head

  4. #4
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    Here's how:
    Code:
    typedef char sample; //or whatever
     
    sample sound1[ length ] = ...
    sample sound2[ length ] = ...
     
    sample output[ length ];
     
    for (int i=0;i<length;++i)
    output[i] = (sound1[i] + sound2[i]) / 2;
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Program Deployment and DLL/OCX Files?
    By dfghjk in forum C++ Programming
    Replies: 5
    Last Post: 06-16-2008, 02:47 AM
  2. accessing all files in a folder.
    By pastitprogram in forum C++ Programming
    Replies: 15
    Last Post: 04-30-2008, 10:56 AM
  3. Mixing wav files using ANSI C
    By crouchy8 in forum C Programming
    Replies: 15
    Last Post: 04-13-2008, 02:51 PM
  4. Wav files and winbase.h
    By ZapoTex in forum C Programming
    Replies: 5
    Last Post: 02-24-2005, 05:17 PM
  5. DLLs <- sound files, and nesting.
    By sean in forum C++ Programming
    Replies: 2
    Last Post: 10-28-2002, 05:13 PM