MCISendString

wow at together.net wow at together.net
Mon May 5 17:53:04 EDT 2008


I have a few customers who tell me the following function does not seem to
be working under Windows XP when they are using a built-in mic. They are
not able to record sound. Does this code need to be modified to specify the
device to record from or does it always record from the mic specified as
the default device in the "Sound and Audio Devices Properties" screen?

Thanks.
Richard Miller
--------------------------------------

local isrecording  = false
local recordfname

on wavStartRecording tfile
  if isrecording is true then wavStopRecording
  put tfile into recordfname
  if there is a file recordfname then delete file recordfname
  get MCISendString("open new type waveaudio alias myrecordsound")
  get MCISendString("set myrecordsound bitspersample 8")
  get MCISendString("set myrecordsound channels 1")
  get MCISendString("set myrecordsound samplespersec 8000")
  get MCISendString("set myrecordsound bytespersec 8000")
  get MCISendString("set myrecordsound time format ms")
  get MCISendString("record myrecordsound")
  put true into isrecording
end wavStartRecording

function wavIsRecording
  return MCISendString("status myrecordsound mode") is "recording"
end wavIsRecording

on wavStopRecording
  put false into isrecording
  get MCISendString("stop myrecordsound")
  get MCISendString("save myrecordsound "&recordfname)
  get MCISendString("close myrecordsound")
end wavStopRecording

function wavRecordLoudness
  if isrecording is false then return 0
  return MCISendString("status myrecordsound level")
end wavRecordLoudness


--------------------------------------------------------------------
mail2web - Check your email from the web at
http://link.mail2web.com/mail2web





More information about the use-livecode mailing list