Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Audio : DirectSound vs Win32 API ?

Audio : DirectSound vs Win32 API ?

Scheduled Pinned Locked Moved C / C++ / MFC
visual-studiojsonquestion
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    HVoss
    wrote on last edited by
    #1

    I want to start with audio programming and want to know the advantages and disadvantages of using DirectSound and of the Windows SDK audio functions (waveIn and waveOut). Which is better to handle? Which is faster or more powerfull? Which is better to use? Thanks for helping Heiko Voss

    B P 2 Replies Last reply
    0
    • H HVoss

      I want to start with audio programming and want to know the advantages and disadvantages of using DirectSound and of the Windows SDK audio functions (waveIn and waveOut). Which is better to handle? Which is faster or more powerfull? Which is better to use? Thanks for helping Heiko Voss

      B Offline
      B Offline
      badal_akr
      wrote on last edited by
      #2

      Basically Win32 API also very good to use i found Direct Sound is more complex. And within Win32 u can manage all the audio Signal properties i,e Sampling, Mono or stereo. Data rate call back etc.... Anil Kumar

      1 Reply Last reply
      0
      • H HVoss

        I want to start with audio programming and want to know the advantages and disadvantages of using DirectSound and of the Windows SDK audio functions (waveIn and waveOut). Which is better to handle? Which is faster or more powerfull? Which is better to use? Thanks for helping Heiko Voss

        P Offline
        P Offline
        peterchen
        wrote on last edited by
        #3

        DirectSound is faster and mroe Powerful. waveOut is better to use. It all depends on what you want to do. What do you want to do?


        Pandoras Gift #44: Hope. The one that keeps you on suffering.
        aber.. "Wie gesagt, der Scheiss is' Therapie"
        boost your code || Fold With Us! || sighist | doxygen

        H 1 Reply Last reply
        0
        • P peterchen

          DirectSound is faster and mroe Powerful. waveOut is better to use. It all depends on what you want to do. What do you want to do?


          Pandoras Gift #44: Hope. The one that keeps you on suffering.
          aber.. "Wie gesagt, der Scheiss is' Therapie"
          boost your code || Fold With Us! || sighist | doxygen

          H Offline
          H Offline
          HVoss
          wrote on last edited by
          #4

          I want to do ALL :-) Record, play, save as WAV and read WAV. Perhaps some processing. But my actual task is a full duplex application. I tried the FullDuplex example of DirectX SDK (9.0c) and got a latency of nearly a second!!! I build also a full duplex application with Win API and got a latency in "normal" range (smaller than 0.1s). I was surprised and posted my question. If DirectX is more powerfull i want to use it. But what's with this really long latency time? I tried the original example! Greetings Heiko

          B P 2 Replies Last reply
          0
          • H HVoss

            I want to do ALL :-) Record, play, save as WAV and read WAV. Perhaps some processing. But my actual task is a full duplex application. I tried the FullDuplex example of DirectX SDK (9.0c) and got a latency of nearly a second!!! I build also a full duplex application with Win API and got a latency in "normal" range (smaller than 0.1s). I was surprised and posted my question. If DirectX is more powerfull i want to use it. But what's with this really long latency time? I tried the original example! Greetings Heiko

            B Offline
            B Offline
            badal_akr
            wrote on last edited by
            #5

            Hey Heiko, Can you exactly tell me how do you measure the Latency. It will be helpfull for me. Regards Anil Kumar

            H 1 Reply Last reply
            0
            • B badal_akr

              Hey Heiko, Can you exactly tell me how do you measure the Latency. It will be helpfull for me. Regards Anil Kumar

              H Offline
              H Offline
              HVoss
              wrote on last edited by
              #6

              Hi Anil, I speak in a microphone, the signal is going through the application, send to the output and i listen to it with headphones. The time between talking and hearing is my latency. It's not really a scientific method but for a first test it's ok. And the difference between the two used samples is clearly to hear. Later i will measure the latency between input and output with a more exact method. Greetings Heiko

              1 Reply Last reply
              0
              • H HVoss

                I want to do ALL :-) Record, play, save as WAV and read WAV. Perhaps some processing. But my actual task is a full duplex application. I tried the FullDuplex example of DirectX SDK (9.0c) and got a latency of nearly a second!!! I build also a full duplex application with Win API and got a latency in "normal" range (smaller than 0.1s). I was surprised and posted my question. If DirectX is more powerfull i want to use it. But what's with this really long latency time? I tried the original example! Greetings Heiko

                P Offline
                P Offline
                peterchen
                wrote on last edited by
                #7

                I don't know much about the original example :) With DS, I have a playback/capture offset of about 500 samples in a release build (this includes codec delay, but not playback latency - but that's a few ms) There might be some processing in the default sample (e.g. capturing 1 s of data, processing it, and playing it back), some bad SC config or whatever. DirectSound shines for playback when you are mixing multiple buffers, do 3D sound effects, etc. Capture is a bit neglected in the DirectSound API. I am not sure if the waveOut API supports more than the 2 channels / 48kHz API - check that if you need it! OTOH, the waveI/O is extremely simple compared to DirectSound. In DirectSound, you cannot get robust duplex without running your own threads. You need some basic understanding of COM, and you have gazillions of soundcard configuraiton options, which you will spend a lot of frustrating time fine-tuning them.


                Pandoras Gift #44: Hope. The one that keeps you on suffering.
                aber.. "Wie gesagt, der Scheiss is' Therapie"
                boost your code || Fold With Us! || sighist | doxygen

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups