MCISendString

2008-05-05 Thread [EMAIL PROTECTED]
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


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


video size on PC - mciSendstring

2005-08-31 Thread sims

I am playing videos on a PC using the wonderful example app mciMpegVideo.rev
made by Signe Marie Sanne (can be found on Rev online at sms).

On OSX I use a player object and can resize the movie by locking the dimensions
of the player. That way I only need one set of videos to refer to 
(set the filename).
I use over 100 videos so this saves a great deal of space as I need 
two sizes of

each video.

Question: is the any way to resize the video (not the window size but 
the video size)

with mciSendstring?

ciao,
sims
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: using MCISendString to record

2005-03-30 Thread Signe Marie Sanne
I am still waiting to get the key to be able to upload a small stack to 
RevOnLine. While waiting I have extracted all the scripts. Many of them have 
been adapted from a stack by Tom McCarthy, St. Catalina Girls School, 
Matsuyama, Japan:

on react
  move target rel 1,1
  wait 10 ticks
  move target rel -1,-1
end react
---Disables QT:
on mouseUp
  react
  set dontUseQT to true
  get the dontUseQT
  if true then answer QT is not in use
  else answer QT is still in use
end mouseUp
Check if mciSendString is installed:
on sjekkeMCI
  react
  put This computer probably lacks recording options. into line 1 of temp
  put Check the presence of Windows Multimedia Tools. into line 2 of temp
  put This can be done by searching for the file 'mciwave.drv'. into line 
3 of temp
  put More info about 'mciSendString':  into line 5 of temp
  put 
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/htm/_win32_mcisendstring.asp; 
into line 7 of temp
  put temp into svar
  put specialfolderpath(system) into t
  put /system/mciwave.drv after t
  if there is not file t then answer svar
  else
--Lists all devices:
put mciSendString(sysinfo all quantity) into xMax
#put empty into fld deviceNames
put empty into tDeviceNames
repeat with x = 1 to xMax
  put sysinfo all name  x into commandString
  # put mciSendString(commandString)  return after fld deviceNames
  put mciSendString(commandString)  return after tDeviceNames
end repeat
#answer tDeviceNames
if WaveAudio is not in tDeviceNames then answer svar
else  answer Windows Multimedia Tools is available.
  end if
end sjekkeMCI

Finds the folder in which you store the audiofile
and gives it a name
on mouseUp
  global tFile  --short name of the file, for instance mySound.wav
  global tLongPath --long name of file:C:/.../.../SoundFolder/mySound.wav
  answer folder Save into which folder:
  if it is empty or the result is Cancel then exit mouseUp
  put it into tFolder
  ask Save as wave file: with .wav
  if it is empty or the result is Cancel then exit mouseUp
  put it into tFile
  put tFolder  /  tFile into tLongPath
  answer tLongPath
end mouseUp
function myMCI tstring
  put mciSendString(tstring) into returnValue
  get the result
  if the result is not empty then
return error
  else
return returnValue
  end if
end myMCI
-Records the sound:
on RecordAudio
  --Startvar:
  global tFile
  react
  put 1500 into max_time
  get mcirecord(tFile, max_time)
end RecordAudio
function mcirecord tFile, max_time
  get mymci(close myaudio)
  put open new type waveaudio alias myaudio into tstring
  get myMCI(tstring)
  if it is error then
return error -- opening part
exit mcirecord
  end if
  --TIMEFORMAT
  get mymci(set myaudio time format milliseconds)
  if mymci(record myaudio) is not empty then
get mymci(close all)
return error -- record part
exit mcirecord
  end if
end mcirecord
-- Stops and saves the audio file to disk
on stopRecording
  --Viderevar:
  global tLongPath
  react
  get mymci(stop)
  put save myaudio   quote  tLongPath  quote into x
  get mymci(x)
  return it
end stopRecording
--Plays the audio file with mciSendString
on listen
  global tFile, tLongPath
  react
  if there is a file tLongPath then get playmysound(tFile)
end listen
function playmysound tFile
  get myMCI(close myaudio)
  --OPEN
  put open quote tLongPath  quote type waveaudio alias myaudio 
into tstring
  get myMCI(tstring)
  --GET LENGTH
  put myMCI(status myaudio length) into ttime
  if ttime is error or ttime is not a number then
put 0 into ttime
return ttime
  end if
  --PLAY
  if myMCI(play myaudio from 0) is error then
return 0
  end if
  return ttime
  put ttime
end playmysound

- Stops playing the audio file:
on stopPlaying
  react
  get myMCI(close myaudio)
end stopPlaying
___
use-revolution mailing list
use-revolution@lists.runrev.com
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: using MCISendString to record

2005-03-29 Thread Signe Marie Sanne
So, I was hoping someone would care to explain how to use MCISendString for
doing the following record sound steps:
1) start recording
2) stop the recording
3) name the file that contains that recording
Thank you.
Hello Nicolas
I'm just back from Easter holidays. Will post a recipe within the next days.
Signe Marie Sanne
___
use-revolution mailing list
use-revolution@lists.runrev.com
http://lists.runrev.com/mailman/listinfo/use-revolution


using MCISendString to record

2005-03-27 Thread Nicolas Cueto
Further on my problem with record sound on Windows 98SE and 2k (i.e., it
causes a delay/system-freeze of over 30 seconds).

Delving deeper into the archives, mention was made of MCISendString as a
possible solution to a problem very similar to mine. (Also mentioned was the
possibility that system memory was the culprit, which I confirmed as not so
in my own case.) Fortunately, I found some sample stacks that used this
Windows-only command and got a taste of how it works. However, I could not
find a stack that used MCISendString for recording, and the MCI
documentation is overwhelming.

So, I was hoping someone would care to explain how to use MCISendString for
doing the following record sound steps:

1) start recording
2) stop the recording
3) name the file that contains that recording

Thank you.

--
Nicolas Cueto

___
use-revolution mailing list
use-revolution@lists.runrev.com
http://lists.runrev.com/mailman/listinfo/use-revolution


MCIsendstring--status level

2004-12-21 Thread Thomas McCarthy

I'm a big fan of MCIsendstring. Really a lifesaver when making stuff for 
Windows.
So a quick question. I use the waveform recorder a lot. I would like to show an 
input level, like I can do with my mac version. I see status level is a 
possible command string, but it doesn't seem to work.

Anyone have luck with it?
thanks
tom

___
Join Excite! - http://www.excite.com
The most personalized portal on the Web!
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


MCIsendstring--Audio CD--Mac equivilent?

2004-12-21 Thread Thomas McCarthy

One of my favorite uses for MCI commands is to control the CD drive.

Is there a way to do so on the mac. Perhaps with shell commands?

tom

___
Join Excite! - http://www.excite.com
The most personalized portal on the Web!
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


MIDI volume (Re: mciSendString for volume)

2003-10-31 Thread curry
Dar Scott wrote:

Wild guesses to try:

mci setaudio mid volume to 30
mci set mid volume to .3
midiOutSetVolume
Hey Dar, thanks for those guesses!

I tried all kind of stuff with MCI but got absolutely nowhere. I'm 
not sure if volume is supported for MIDI by that route or not. (If 
anyone knows, give a holler please! It seems like MCI should do it, 
theoretically, but I haven't been able to find the way.)

But, that last one you mentioned got me hopeful again--I haven't done 
any Win API programming so I didn't know it, but I looked it up and 
it looks good. If MCI can't do the MIDI volume at all, this looks 
like my best bet.

Maybe the new fmod external can address this for you.
Well, I really think that one is super, right on because we do need 
good non-QT support on Windows, and worth the cost of FMOD if you use 
all the features. But in this case, it seems like overkill since my 
project is all ready to go other than controlling the MIDI volume, 
and I'd have to license FMOD. (Also, I still couldn't tell from the 
Rev external download whether it supports all the features, including 
volume.) I think I will consider it in the future though. I think 
that making something that high quality available to Rev is a 
wonderful step.

So, right now I'm thinking to use midiOutSetVolume, perhaps with one 
of the BASIC compilers that support Declare statements and make small 
enough executables. I think that's about the best I can do.

Thanks Dar and if anyone has a better solution do please let me know, 
otherwise I am going to try making a little helper app in BASIC. 
Windows audio in Rev without QT is almost tolerable--MIDI volume 
control is the one thing missing. With it, you have one-channel sound 
effects (OK for many cases) and MIDI at the same time if you like. 
That should do it for most apps and many games.

Best wishes,

Curry
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


mciSendString for volume

2003-10-29 Thread curry
I'm trying to set MIDI volume on Windows so that my stack can control 
the volume for playing .mid files when not using QuickTime.

I looked for info on mciSendString and was successful in playing a 
file, but haven't been successful in finding volume.

Here's the all-purpose handler I use for trying the commands:

on mci x
 replace / with \ in x -- convert any Rev file paths to Windows
 get mcisendstring(x)
 answer it  cr  the result
end mci
The following commands don't work:

mci status sequencer volume
mci set sequencer volume to 30
I did get it to play a file, with file path stored in a field:

mci open  quote  field file  quote  type sequencer alias mid
mci play mid
mci status mid position
mci close mid
But also volume didn't work:

mci status mid volume
mci set mid volume to 30
(There I tried using a specific file just to see if it worked, but I 
would prefer setting volume for the device rather than a file.)

Does anyone know the proper way to do this?

Thanks very much,

Curry
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: mciSendString for volume

2003-10-29 Thread Dar Scott
On Wednesday, October 29, 2003, at 08:05 PM, curry wrote:

mci set mid volume to 30
Wild guesses to try:

mci setaudio mid volume to 30
mci set mid volume to .3
midiOutSetVolume

Oh, wait.  That last one might take an external.

(I put my MCI reference is storage; sorry.)

Maybe the new fmod external can address this for you.

Dar

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution