audio programming (from scratch)

This is a discussion on audio programming (from scratch) within the C Programming forums, part of the General Programming Boards category; I'm interested in understanding how to write code which will connect to the audio device / system mixer and retrieve ...

  1. #1
    Registered User
    Join Date
    Jul 2006
    Posts
    162

    audio programming (from scratch)

    I'm interested in understanding how to write code which will connect to the audio device / system mixer and retrieve samples of audio, from scratch. From nothing to audio. I'm not exactly sure how to begin with it, can anyone help me out?

    I tried to search google for a while, but all my searches were unhelpful, I'm not sure exactly what specifically to search for so I guess I'm using far too general of terms.

    Please don't suggest any existing audio libraries for me to use, that would be frustrating and a waste of time. I specifically want to learn how to do this myself. I'll appreciate any help...

    I've become so interested in audio programming I want to know it inside out, hence wanting to develop even my own library. (I'm not new to audio programming in general, just to this specific part of it.)


    Thanks!

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    Your best bet would be to find an open source audio library that does the things you want and study their code. I'm reasonably sure you'll be disappointed at the internals, but there's no experience like a good whack from the reality wiffle bat.
    My best code is written with the delete key.

  3. #3
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    I'm reasonably certain that what you are asking for is the lower level methods that the OS gives you. For Windows, you can use the waveOut.... functions found at the bottom of this page http://windowssdk.msdn.microsoft.com...94(vs.80).aspx
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  4. #4
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    and this http://www.borg.com/~jglatt/tech/wave.htm will give you the format of a wav file.
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  5. #5
    Registered User
    Join Date
    Jul 2006
    Posts
    162
    Well, it's informative and I'll go through it to learn it, but in the end I'd like to get even lower if possible. What does the OS (windows) do to achieve those things might be closer to what I actually want.

    Say I'm writting a library for audio that I wanted to work on any unix and windows os, that would mean what the OS gives me is too high.

    And going through an existing open source audio library sounds unintuitive. I'll give that a shot but if I'm stuck with uncommented code I'm not going to actually learn much. I'm interested also in the general architecture of audio devices, and how exactly they get the audio from the line_in to the systems memory. I assume that's where it goes, and then I would use assembly to access and read from that memory location?

    That could be completely wrong, I'm only using that to clarify how low I'm trying to talk about.

  6. #6
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    the thing is, the operating system hides the hardware for a reason. You REALLY don't want to write drivers for every type of sound device. Now with that in mind, the way the OS hides the hardware is different from one OS to another. So.... you pretty much should use the functions that they provide.

    cross platform solution:
    Provide a common interface of your own that is implemented for each system's set of functions.
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  7. #7
    Registered User
    Join Date
    Jul 2006
    Posts
    162
    Oh, well ok then. Thanks for the help and the url for the windows lower level methods. After looking through that site a bit I can see it lets me get everything I was looking for anyway. So it will be fine, and keep me entertained.


    Thanks again!
    Last edited by simpleid; 07-26-2006 at 09:35 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Audio Programming
    By dwalters in forum Tech Board
    Replies: 0
    Last Post: 02-07-2008, 03:20 PM
  2. Audio Drivers
    By Tonto in forum Tech Board
    Replies: 8
    Last Post: 08-30-2006, 09:07 PM
  3. Bluetooth Audio Stream
    By Charmy in forum Windows Programming
    Replies: 2
    Last Post: 05-06-2006, 12:10 AM
  4. Port Audio
    By samGwilliam in forum Windows Programming
    Replies: 9
    Last Post: 12-07-2005, 10:43 AM
  5. Audio programming... ( Perhaps Off-topic ?? )
    By KeM in forum C Programming
    Replies: 4
    Last Post: 02-16-2002, 12:15 AM

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