Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

HOW TO OPEN WAV FILES IN C++

DhivadDhivad Member Posts: 2
hey guys.. can you help in this one?

how do i open a wav file?
as of now i got this code but still dunno how to place the wav file in the szFileName pointer...


code:

virtual serror open (const char *szFileName);

Comments

  • veliusvelius Member Posts: 456
    : hey guys.. can you help in this one?
    :
    : how do i open a wav file?
    : as of now i got this code but still dunno how to place the wav file in the szFileName pointer...
    :
    :
    : code:
    :
    : virtual serror open (const char *szFileName);
    :
    const char *szFileName implies a pointer to a char array which is the name of the array.
    [code]
    char wavFile[] = "C:\path\to\file\name\filename.wav";

    ...

    open(wavFile);[/code]

    The double backslashes are required in a string of chars to put the actual single backslash into the array as they're escape codes. And the pointer to the array is the name itself as you can see by that overly simple example.

    Good luck.
    [hr]
    We'll be an army of theives
    Of self-freed slaves
    Of mild-mannered maids
    We'll fight with whispers and blades
    So get ready, a new day is dawning
    - The New Wild West -- Jewel

Sign In or Register to comment.