Giving commands to Sound Recorder in OLE

J

Jon Lehrer

Hoping for some advice:
I would like to write some code that controls
the "window's sound recorder" that I embedded in my
program with OLE. I can do this with Excel
(OLE1.Object.Parent.Activecell.Formula = "Hi") because I
know the commands from VBA in Excel.
Is there a way to do this with Windows Sound Recorder?
Some line of code that would, for example, allow me to
change the sample rate so that the user could record
sounds at 8000 samples per second (instead of the default
22.5 KHz) without having to know to navigate the menu
system and change that manually each time?
By the way, if you know of a different way to do this
(change the program's default settings before embedding
it, etc) that would be great, but if there is a way to
talk directly to Sound Recorder I'd like to know how to do
that.

The project I'm working on involves having the user record
themselves speaking a word and then display all sorts of
info about the sound wave they produced. Its as part of a
class on voice recognition. I've already had to weasel my
way into getting to the binary data for the wav file that
the user records (OLE1.SaveToFile, then take that *.ole
file it creates and pull out the part of it that contains
the wav data) but it would be nice to be able to save the
data as an actual wave file, or, even better, just access
what the OLE object is storing in memory without having to
save.

Thanks in advance
Jon
 
T

Tom Spink

Perhaps you should look at the WaveIn* API commands, then you can do wave
recording and memory storing and what not yourself :) I'm sorry, I don't
have a link but a quick search on Google should do the trick.

--
Happy to help,
-- Tom Spink
([email protected])

" There's no place like 127.0.0.1 "

Please respond to the newsgroup,
so all can benefit.


One Day,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top