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. Writing data to the sound card

Writing data to the sound card

Scheduled Pinned Locked Moved C / C++ / MFC
question
8 Posts 4 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.
  • T Offline
    T Offline
    Tony Pottier
    wrote on last edited by
    #1

    Hi, I'm trying to write a wav file to the sound card, but how are you supposed to do this? You can find various libraries to play all kind of music but what's hidden behind those libraries? Basically, what should I do to directly send data to the sound chip? I can't find much information about this... Thanks, Tony

    C D 2 Replies Last reply
    0
    • T Tony Pottier

      Hi, I'm trying to write a wav file to the sound card, but how are you supposed to do this? You can find various libraries to play all kind of music but what's hidden behind those libraries? Basically, what should I do to directly send data to the sound chip? I can't find much information about this... Thanks, Tony

      C Offline
      C Offline
      CPallini
      wrote on last edited by
      #2

      I think your best bet would be DirectSound API [^]. :)

      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
      This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
      [My articles]

      T 1 Reply Last reply
      0
      • C CPallini

        I think your best bet would be DirectSound API [^]. :)

        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
        This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
        [My articles]

        T Offline
        T Offline
        Tony Pottier
        wrote on last edited by
        #3

        That's again an API. Is there a way to do something like fopen("soundcard","w") ?

        C 1 Reply Last reply
        0
        • T Tony Pottier

          That's again an API. Is there a way to do something like fopen("soundcard","w") ?

          C Offline
          C Offline
          CPallini
          wrote on last edited by
          #4

          AFAIK, you can't (unless you go in kernel mode). :)

          If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
          This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
          [My articles]

          T 1 Reply Last reply
          0
          • T Tony Pottier

            Hi, I'm trying to write a wav file to the sound card, but how are you supposed to do this? You can find various libraries to play all kind of music but what's hidden behind those libraries? Basically, what should I do to directly send data to the sound chip? I can't find much information about this... Thanks, Tony

            D Offline
            D Offline
            Divyang Mithaiwala
            wrote on last edited by
            #5

            Are you looking for something like Sample Audio Drivers[^]?


            Do not trust a computer... Always check what computer is doing regards, Divyang Mithaiwala Software Engineer

            T 1 Reply Last reply
            0
            • C CPallini

              AFAIK, you can't (unless you go in kernel mode). :)

              If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
              This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
              [My articles]

              T Offline
              T Offline
              Tony Pottier
              wrote on last edited by
              #6

              Too bad then :(

              1 Reply Last reply
              0
              • D Divyang Mithaiwala

                Are you looking for something like Sample Audio Drivers[^]?


                Do not trust a computer... Always check what computer is doing regards, Divyang Mithaiwala Software Engineer

                T Offline
                T Offline
                Tony Pottier
                wrote on last edited by
                #7

                Well I was trying to write a MP3 player I could easily port to the Nintendo DS by going very low level (ie: fwrite to the sound card). But well, if can't speak directly with the sound device I guess this isn't going to work.

                M 1 Reply Last reply
                0
                • T Tony Pottier

                  Well I was trying to write a MP3 player I could easily port to the Nintendo DS by going very low level (ie: fwrite to the sound card). But well, if can't speak directly with the sound device I guess this isn't going to work.

                  M Offline
                  M Offline
                  molesworth
                  wrote on last edited by
                  #8

                  Tony_P wrote:

                  Well I was trying to write a MP3 player I could easily port to the Nintendo DS by going very low level (ie: fwrite to the sound card). But well, if can't speak directly with the sound device I guess this isn't going to work.

                  Anything like an "fwrite to the sound card" just plain isn't going to work. Sound cards, like graphics cards, require data to be passed in the right way, and to the right buffer addresses etc, which is why there are drivers and APIs to help you do this. I'm a game audio programmer, working on PC at the moment, but I've written systems for most consoles in the past - unfortunately not for the DS, so I can't give you specific advice, but it too will have a specific API which is how you should send the audio data and control information to the hardware. In fact a quick google turns up lots of hits for DS homebrew audio (e.g. here) and the interface looks pretty simple. You should be able to get sounds up and running reasonably quickly using that.

                  There are three kinds of people in the world - those who can count and those who can't...

                  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