Urgent Help!!!

This is a discussion on Urgent Help!!! within the C++ Programming forums, part of the General Programming Boards category; I need immediatly a C++ function that exports a '.mp3' or '.wav' file from a variable. The variable is int ...

  1. #1
    Registered User
    Join Date
    Jan 2007
    Posts
    2

    Exclamation Urgent Help!!!

    I need immediatly a C++ function that exports a '.mp3' or '.wav' file from a variable.
    The variable is int song[position], where position is a long variable. I promise that whoever gives me the function, will recieve the software that I am currently working(for writing music).

  2. #2
    pwns nooblars
    Join Date
    Oct 2005
    Location
    Portland, Or
    Posts
    1,094
    Read the link in my sig. Once you are enlightened, come back and maybe we can have a conversion.

  3. #3
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,484
    Quote Originally Posted by Chri5ty
    I need immediatly a C++ function that exports a '.mp3' or '.wav' file from a variable.
    The variable is int song[position], where position is a long variable. I promise that whoever gives me the function, will recieve the software that I am currently working(for writing music).
    int contains about 4 bytes... wav or mp3 can store Megs of info... How do you plan to convert 4 bytes into Megs of data?
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

  4. #4
    Registered User
    Join Date
    Jan 2007
    Posts
    330
    Quote Originally Posted by Chri5ty
    I need immediatly a C++ function that exports a '.mp3' or '.wav' file from a variable.
    The variable is int song[position], where position is a long variable. I promise that whoever gives me the function, will recieve the software that I am currently working(for writing music).
    untested!

    Code:
    #include <stdio.h>
    
    int main(void)
    {
      FILE *fp;
      int song[10] = {0,1,2,3,4,5,6,7,8,9};
      int position  = 4;
    
      char file[128];
    
      sprintf(file, "%d.wav", song[position]);
      fp = fopen(file, "w");
    
      if (fp)
      {
        fputs("Im only happy when it rains\n"
                 "Im only happy when its complicated\n"
                 "And though I know you cant appreciate it\n"
                 "Im only happy when it rains\n", fp);
    
        fclose(fp);
      }
    
      return 0;
    }

  5. #5
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,475
    Please do not yell in posts
    I'm just trying to be a better person - My Name Is Earl

  6. #6
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,548
    Closed for complete lack of netiquette and not reading the forum rules.
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. display character size...(quite urgent..)
    By karthi in forum C Programming
    Replies: 10
    Last Post: 07-11-2007, 09:42 PM
  2. beginner plzz help urgent
    By sara101 in forum C Programming
    Replies: 11
    Last Post: 01-14-2007, 09:38 PM
  3. Linked List Need Help Urgent
    By ykchua in forum C Programming
    Replies: 5
    Last Post: 08-17-2004, 02:57 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21