All, I am trying to directly control the built-in soundcard in my laptop. I know how to play MP3s and WAVs and such. I want to be about to directly control the soundcard and produce my own waveforms and also have amplitude control of all soundcard output.
Any ideas or function calls?
Keith
To produce your own waveforms you will need to use mathematical functions to create the byte stream and you can then use the Playsound API to play it..
Gremmy,
Thanks for the reply, but..., the examples just show how to play a wav file. I want to be able to setup the attack, sustain, decay, and release of A single wave form and control the output. Kindof like the old Commodre computers allowed you to do. If I wanted to send out a triangle wave, a square wave, a sawtooth wave, stepped sine, pure sine, etc... and be able to vary the frequency, how do I control the soundcard directly. For example, during the early days of PCs a sound card would have a buss address of around H300 then you could control different registers by POKEing values into different addresses, hense controlling the soundcards output.
I am trying to generate IRIG-B though software and the soundcard output (which can be done) instead of by my hardware.
Gremmy, You know, If I could figure out how to send just 1 cycle of a sine wave at 1KHz or (1ms) at different amplification levels, then the rest should be easy. What do you think?
Keith
OK, I can create the array with the correct values, but how do I pass it to playsound, when it is looking for a filename to play? Sorry for the illiteritcy (sp?) Keith
Gremmy,
I found some code for what I think is DirectSound. The Sine...zip file is the original, and I have similified it to test4gremmy.zip
(Sine...zip is VB6 & test4gremmy.zip is VB5) (I don't have VB6)
Problem, I can get 1 pulse out (1 single sinewave at 1khz), but then I don't get another pulse out until 20ms later. Even with playing with the timer to 1ms. Is there a min time for Timer? and is there a min. time for the Directsound calls?
Also, where can I get a list of all the functions and description of the Directsound function calls?
Thanks,
Hi Gremmy, Correct, I can get a nice constant tone out, but.... I need to have control of the amplitude (volume) to an accuracy of each cycle. Even putting the following:
back to back, I still get a lag of 20ms before the 2nd command is executed, (sometimes it isn't executed at all) The function call must take all the computer process time until it is finished with whatever it has to do, which I don't know what that is.
There is software out there that can produce IRIG-B signal out the speaker port, but they are reading the computer time and then producing an output. This is kindof what I want, but I want to count down to an event, and output the time in an IRIG-B format.
I just don't know if they did it in C or VB. I did read that with C you have more control over hardware items, but I don't know if that is exactly true.
and, they are not so eager to let me in on their secret.
I will keep plugging away, and see what I come up with.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.