![]() |
||
| Home | SwiftForth Archive | SwiftX Archive | |

Hi Richard,
Sound and video sources, including your USB microphone,
may be accessed through the WINMM.DLL (Windows
Multi-Media)
Searching the web with WINMM.DLL gives some good info.
Basically, you ask the DLL to enumerate what sound sources
are available, and your USB mike should appear in the
list (along with CD drive, etc.). You then open the
device and get a handle. When you open it, you can
specify the format you want the data in (many formats are
defined and the DLL will tell you which ones are supported
for your microphone). When you open the file (or later
on) you specify how you want the data sent to you: what
size block (which determines how often you get new data)
how many blocks and where they are, and how you are
notified when new data is ready (via callback, or by
windows message, for example).
You have commands to start the stream, stop it, set
volume, find recording status etc. The stream is
presented to you as a series of memory blocks, and a
popular way to handle the stream is by setting up two
blocks. The DLL fills one as you process the other, then
you flip-flop when new data are available (double
buffering).
I've posted a code snippet that does a similar thing: it
opens a speaker for playing sound, accepts input from a
DSP card I designed, then plays the sound. It uses triple
buffering: www.madengineer.com/mmonkey/monitor.f
This file won't compile as it depends on other files, but
hopefully you can follow the procedure. Getting an input
stream with the WaveIn functions is very similar.
Hope this helps,
Glenn
On Sat, 24 Jan 2004 11:45:51 -0600
Richard Owlett <rcowlett_at_atlascomm.net> wrote:
>Jerry Avins wrote:
>> Richard Owlett wrote:
>>
>> ...
>>
>>
>>>I have the driver and it works fine.
>>>What I want to do is access it from Swiftforth.
>>
>>
>> I'm obviously not the one to give you a good answer, but
>>before anyone
>> can, you'll have to reveal what the microphone device
>>"looks like" to
>> the system. Is it a bit stream? A file?
>
>That's would be part of the info I need ;}
>What I know is its a USB 1.0 device conforming to USB
>Audio 1.0.
>WindowsXP correctly identifies it as AK5370.
>
>I suspect from file names that I'm looking for info on
>usbmon.dll and usbui.dll.
>
>
>> You should be able to plug a mic
>> into the sound card and use the output from there. It
>>might be an easier
>> interface.
>>
>
>Probably, but I need to use USB as access to sound card is
>physically non-optimal.
>> Jerry
>
>
>----------------------------------------------------------------------
>sftalk_at_forth.com The SwiftForth programming
>discussion email list
>To unsubscribe, send subject "unsubscribe" to
>sftalk-request_at_forth.com
>For list command help, send subject "help" to
>sftalk-request_at_forth.com
>Message archives are located at
>http://www.forth.com/archive/sftalk
>----------------------------------------------------------------------
>This list is a forum for SwiftForth users. For product
>support and bug reports, please send email to
>support_at_forth.com
>----------------------------------------------------------------------
>
*********************************
Get your free E-Mail and Homepage
Go to http://www.networld.com
*********************************
----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
For list command help, send subject "help" to sftalk-request_at_forth.com
Message archives are located at http://www.forth.com/archive/sftalk
----------------------------------------------------------------------
This list is a forum for SwiftForth users. For product support and bug
reports, please send email to support_at_forth.com
----------------------------------------------------------------------
Received on Tue Jan 27 2004 - 06:00:02 PST
This archive was generated by hypermail 2.2.0 : Wed Nov 19 2008 - 03:04:22 PST