Thread: writing a wave file from my wave samples

  1. #1
    Registered User Queatrix's Avatar
    Join Date
    Apr 2005
    Posts
    1,342

    writing a wave file from my wave samples

    Say I have a big list of wave samples, can I write those wave samples to a wave file? If possible, how?

    Thanks, August.

  2. #2
    Registered User kryptkat's Avatar
    Join Date
    Dec 2002
    Posts
    638
    yes. open sample1.wav store data in array. go through all sample files. rewrite new wave file with all data.



    http://msdn.microsoft.com/library/de..._functions.asp

    http://msdn.microsoft.com/library/de...waveinopen.asp
    Last edited by kryptkat; 12-31-2005 at 04:07 PM.

  3. #3
    int x = *((int *) NULL); Cactus_Hugger's Avatar
    Join Date
    Jul 2003
    Location
    Banks of the River Styx
    Posts
    902
    From how I'm understanding this you basically want to append wave files together. I'm not sure that the functions provided by kryptkat will be any use - I think they're only good for playing, not interpreting wave files.

    But you do need to read the files in and out. I'd recommend going to Wotsit's and reading up on the wav file format. Search the web. The Wikipedia article, while containing little info itself, appears to have some nice links that might help.

    A best case scenario is that all your wave files have the exact same sample rate and bits per sample, and they're all just PCM. (Wave files can be compressed - rare, but possible.) If they don't, you'll have to choose what you'd like the result to be, and convert them.
    long time; /* know C? */
    Unprecedented performance: Nothing ever ran this slow before.
    Any sufficiently advanced bug is indistinguishable from a feature.
    Real Programmers confuse Halloween and Christmas, because dec 25 == oct 31.
    The best way to accelerate an IBM is at 9.8 m/s/s.
    recursion (re - cur' - zhun) n. 1. (see recursion)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A development process
    By Noir in forum C Programming
    Replies: 37
    Last Post: 07-10-2011, 10:39 PM
  2. opening empty file causes access violation
    By trevordunstan in forum C Programming
    Replies: 10
    Last Post: 10-21-2008, 11:19 PM
  3. Encryption program
    By zeiffelz in forum C Programming
    Replies: 1
    Last Post: 06-15-2005, 03:39 AM