Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to read signal and set sampling rate from PC audio line-in?

Status
Not open for further replies.

aghielan

Member level 2
Member level 2
Joined
Jun 1, 2006
Messages
45
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,546
How to read signal & set sampling rate from PC audio Line-in. What is the address? please help me on this topic. Thanks in advance..
 

capture audio line input vb

Create a capture buffer in DirectSound which is part of the DirectX SDK. It will allow you to set the sampling rate (I believe some cards are hard-wired to a few frequencies while others allow any rate but I'm not too sure, I've always used the standard 44 KHz rate). I believe it also lets you sample in stereo or mono. You can also pump the data into an output buffer and create an FX chain on that output, that's where it gets real fun. I used it to rewrite a college lab that did digital filtering with an ISA card that sampled at 15 KHz, in an old DOX Box that ran at 8 MHz. It was on it's last legs so I did the capture in DirectSound. The students then had to write the filter function to transform the raw samples into filtered samples and the filtered samples were sent to the output buffer to be measured on the scope. The instructor loved me for that one.
To get on with it, I believe there is the equivalent of some kind of sound input device in the OpenGL SDK but you would have to check it out. CreativeLabs has an OpenAL SDK that allows for the creation of capture buffers but I've never used it. Java also has (I think) some kind of sound class that allows the capture of sound input. But all in all, I think you are best off to do it with DirectSound in VB or VC++.

Of course, if someone has the specs on the Soundblaster registers and knows how to read the sampling rate directly that might be the best way to go. The only ones I remember were for the SB16 board by Brodsky and I don't know if they apply to the new boards. Try this link for doing it directly in the SB registers:

https://homepages.cae.wisc.edu/~brodskye/sb16doc/sb16doc.html
 

wavelib linein

Thanks for the info...Is there any reference/example to call this function in VB6? Thanks in advance.


Regards,
aghie
 

vb wavelib

I've used WaveLib to capture audio from the line input. You can search for it and find many examples. The advantage is there is nothing to install - it gets compiled into your code.
If you decide to use the raw register interface to your sound card, your application will not be portable. That means it will only work with one sound card.
If you elect to use an sdk like DirectSound or WaveLib, it will be portable and work with any sound card since each sound card will have it's own driver installed and provide a generic interface.
When testing, make sure you setup the Audio Mixer correctly (most default settings will turn off line input in favor of mic input) or you won't get any audio even if your code is working.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top