Wav files and winbase.h

This is a discussion on Wav files and winbase.h within the C Programming forums, part of the General Programming Boards category; Hi everyone! I'm in trouble again with my c program. I need to play wav files. I searched the old ...

  1. #1
    Registered User
    Join Date
    Jan 2005
    Posts
    12

    Wav files and winbase.h

    Hi everyone!

    I'm in trouble again with my c program. I need to play wav files. I searched the old posts and all I could find was about sndPlaySound. If I use it, my compiler tells me: missing prototype. If I include windows.h, the compiler tells me there are errors in the winbase.h file. It's not a file written by me, then I guess it is correct. Should I include something else?

    Thank you all in advance! This is for my job, it's very important!

    Thank you again very much!

    By!

  2. #2
    ---
    Join Date
    May 2004
    Posts
    1,379
    my favourite audio lib
    www.fmod.org
    very simple to use.

  3. #3
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    Make sure you have included <windows.h> before other headers. You can also use the PlaySound function. You will need to link with Winmm.lib.

  4. #4
    Registered User
    Join Date
    Jan 2005
    Posts
    12
    Thank you very much everybody!!!

    I have included windows.h, but it is my last header, actually! I'll try moving it up. And I'll try fmod too.

    Thank you a lot again, this forum is a very welcoming place, not to mention a very useful resource! Thank you all!

  5. #5
    Registered User
    Join Date
    Jan 2005
    Posts
    12
    I followed your advice: with fmod everything worked perfectly. WIth windows.h as my first include, compiling was successful, but I had a "linking error": symbol sndSoundPlayA@8 undefined.

    I don't know what this means. Anyway fmod is more powerful, it even lets me pre-load my samples and then quickly play them whenever I need to warn the user of my app.

    Thank you very much again!

    PS: i tried to edit my first post and add "SOLVED" to the title, but i couldn't. "Edit" appears on my last post only.

    Thank you again, bye!

  6. #6
    ---
    Join Date
    May 2004
    Posts
    1,379
    No problem. Fmod is quite powerful and it is ported to many many OS's including Xbox and PS2 i believe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. windows header files not linking correctly
    By skorman00 in forum Windows Programming
    Replies: 2
    Last Post: 04-13-2005, 11:14 AM
  2. declaring Winbase.h ?
    By Rune Hunter in forum C++ Programming
    Replies: 4
    Last Post: 10-23-2004, 01:01 AM
  3. winbase.h & thread programming
    By Massive in forum Windows Programming
    Replies: 3
    Last Post: 06-18-2003, 06:51 AM

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