Easy Question

This is a discussion on Easy Question within the Game Programming forums, part of the General Programming Boards category; How do you get a program to generate a sine wave and play it using the sound card?...

  1. #1
    Registered User
    Join Date
    Dec 2005
    Posts
    13

    Easy Question

    How do you get a program to generate a sine wave and play it using the sound card?

  2. #2
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,077
    Eh... that's not easy at all.

    You have to look into libraries that interact with the sound card. DirectX has its deal but I'm sure there are more simple free ones. Sending data to computer peripherals is not a simple thing to do at all. It requires interaction with the drivers and it's generally easier to find prewritten libraries that handle that.
    Last edited by SlyMaelstrom; 06-15-2006 at 07:03 PM.
    Sent from my iPadŽ

  3. #3
    Registered User
    Join Date
    Dec 2005
    Posts
    13
    Ok I found a program for generating the sine waves and saving them as .WAV but i still don't know how to send a .wav to the sound card??

  4. #4
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,077
    MMmkay, well your best bet would be Windows.

    There are tutorials here: http://nehe.gamedev.net/

    ...and #21 has a function known as PlaySound(). Enjoy.
    Last edited by SlyMaelstrom; 06-15-2006 at 10:25 PM.
    Sent from my iPadŽ

  5. #5
    Registered User
    Join Date
    Dec 2005
    Posts
    13
    I'm trying to make a phone dialler that generates the two tones needed for each number in just in case your interested, just pick up your reciever and run the program.

  6. #6
    Registered User
    Join Date
    Dec 2005
    Posts
    13
    Cheers for that, by the way, it works a charm

  7. #7
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    btw: opengl has nothing to do with sound, im sure that tut uses another library for that.

  8. #8
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,077
    I believe it. Yeah it looks like PlaySound is a Windows function. Oh well. I blame communism.
    Last edited by SlyMaelstrom; 06-15-2006 at 10:24 PM.
    Sent from my iPadŽ

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. easy Vector contructor question
    By noodle24 in forum C++ Programming
    Replies: 5
    Last Post: 04-21-2006, 08:43 PM
  2. Another Embarassingly Easy Question
    By almo89 in forum C Programming
    Replies: 2
    Last Post: 02-11-2006, 04:59 PM
  3. This is hopefully an extremely easy question...
    By rachaelvictoria in forum C Programming
    Replies: 2
    Last Post: 11-07-2005, 01:36 AM
  4. 4 easy question
    By Zeratulsdomain in forum C++ Programming
    Replies: 2
    Last Post: 10-15-2005, 11:43 PM
  5. Easy Question
    By Unregistered in forum C++ Programming
    Replies: 2
    Last Post: 08-12-2002, 01:19 PM

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