Writing data to the sound card
-
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
-
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
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] -
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]That's again an API. Is there a way to do something like fopen("soundcard","w") ?
-
That's again an API. Is there a way to do something like fopen("soundcard","w") ?
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] -
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
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
-
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]Too bad then :(
-
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
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.
-
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.
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...