Random Audio Recording Error on Win32 Player
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Random Audio Recording Error on Win32 Player
After years of providing programs for special needs students I was just made aware of my programs failing at random times, making it difficult to debug.
It only happens on Windows machines and not at the same location. The Mac player works fine.
User get an error box- "Revolution Engine for Win32 has encountered a problem and needs to close. We are sorry for the inconvenience."
I am using the REV Player Engine 3.0.0 Build 750 and not a standalone because the same stack need to run on Macs and Pcs.
I am testing it now on a Macbook pro with VMware Fusion.
If a scripter with PC access has time to put this script into a button and try recording, if you have time, I would appreciate feedback on why it fails.
The programs have numerous places for students to record their ideas. I have found the problem occurs whether the script is on multiple buttons or just one.
I have distilled the script down to the basics to eliminate other scripting factors.
All you should need to do is hold the mouse down on the button to record. It should repeat back on mouseUp.
It rarely happens the first time but always randomly within 15 attempts.
on mouseDown
if there is an audioClip "test" then stop playing audioClip "test"
set the recordFormat to "wave"
set the recordSampleSize to 16
set the recordChannels to 1
set the recordRate to 44.1
record sound file "Test"
end mouseDown
on mouseUp
wait 1 second
stop recording
if there is an audioClip "test" then delete audioClip "test"
if there is a file "test" then
import audioClip from file "test"
end if
play audioClip "test"
end mouseUp
Thanks,
Bill
It only happens on Windows machines and not at the same location. The Mac player works fine.
User get an error box- "Revolution Engine for Win32 has encountered a problem and needs to close. We are sorry for the inconvenience."
I am using the REV Player Engine 3.0.0 Build 750 and not a standalone because the same stack need to run on Macs and Pcs.
I am testing it now on a Macbook pro with VMware Fusion.
If a scripter with PC access has time to put this script into a button and try recording, if you have time, I would appreciate feedback on why it fails.
The programs have numerous places for students to record their ideas. I have found the problem occurs whether the script is on multiple buttons or just one.
I have distilled the script down to the basics to eliminate other scripting factors.
All you should need to do is hold the mouse down on the button to record. It should repeat back on mouseUp.
It rarely happens the first time but always randomly within 15 attempts.
on mouseDown
if there is an audioClip "test" then stop playing audioClip "test"
set the recordFormat to "wave"
set the recordSampleSize to 16
set the recordChannels to 1
set the recordRate to 44.1
record sound file "Test"
end mouseDown
on mouseUp
wait 1 second
stop recording
if there is an audioClip "test" then delete audioClip "test"
if there is a file "test" then
import audioClip from file "test"
end if
play audioClip "test"
end mouseUp
Thanks,
Bill
Re: Random Audio Recording Error on Win32 Player
Hi Bill,
I don't have a PC with sound recording capabilities, but here some general thoughts.
1. "record sound" uses QuickTime so make sure this is installed on all target machines
Check "the qtversion" first!
2. You do not specify a directory for the recording, but you need write permission in "the defaultfolder",
whereever this may be currently!
Better use something like e.g. -> specialfolderpath("desktop") & "/test.wav"
3. I takes a little time until everything is initialized "behind the curtains" before the actual recording starts
so maybe doing this on "mousedown" is not a good idea.
Triggering actions "on mousedown" is always a bad idea in my opninion
4. No need to IMPORT the sound!
You can also use the filename with "play", saves some memory!
Try this:
This is out of my head, but you get the picture
Best
Klaus
I don't have a PC with sound recording capabilities, but here some general thoughts.
1. "record sound" uses QuickTime so make sure this is installed on all target machines
Check "the qtversion" first!
2. You do not specify a directory for the recording, but you need write permission in "the defaultfolder",
whereever this may be currently!
Better use something like e.g. -> specialfolderpath("desktop") & "/test.wav"
3. I takes a little time until everything is initialized "behind the curtains" before the actual recording starts
so maybe doing this on "mousedown" is not a good idea.
Triggering actions "on mousedown" is always a bad idea in my opninion

4. No need to IMPORT the sound!
You can also use the filename with "play", saves some memory!
Try this:
Code: Select all
on mouseDown
## no need to check, just stop any eventually playing sound
play stop ac
## We have write permissions here!
put specialfolderpath("desktop") & "/test.wav" into tSoundFile
## Delete old sound? optional :)
if there is s file tSoundFile then
delete file tSoundFile
end if
set the recordFormat to "wave"
set the recordSampleSize to 16
set the recordChannels to 1
set the recordRate to 44.1
record sound file tSoundFile
## If there is something going wrong we might get a hint WHAT is going wrong:
if the result <> empty then
answer "Error:" & CR & the result
exit to top
end if
end mouseDown
on mouseUp
put specialfolderpath("desktop") & "/test.wav" into tSoundFile
wait 1 second
stop recording
if there is a file tSoundFile then
play ac tSoundFile
else
answer "No file!"
end if
end mouseUp

Best
Klaus
Re: Random Audio Recording Error on Win32 Player
Thanks Klaus
The code does work though. It may work once or even 15 times before the error. My full code does save temporarily to a default folder but it still fails at Stop Recording, even before it gets to the importing the sound file and deleting.
bill
The code does work though. It may work once or even 15 times before the error. My full code does save temporarily to a default folder but it still fails at Stop Recording, even before it gets to the importing the sound file and deleting.
bill
Re: Random Audio Recording Error on Win32 Player
Hi Bill,
hmm, sorry, no idea.
BUT
You could try to use the very old MCI interface to record sound on Windows.
I found a VERY old stack from the MetaCard days and will attach it here.
Maybe NOT using QuickTime will give better results
Best
Klaus
hmm, sorry, no idea.
BUT

You could try to use the very old MCI interface to record sound on Windows.
I found a VERY old stack from the MetaCard days and will attach it here.
Maybe NOT using QuickTime will give better results

Best
Klaus
- Attachments
-
- mci.rev.zip
- (7.44 KiB) Downloaded 369 times
Re: Random Audio Recording Error on Win32 Player
Just tried it with your code and it still fails after about 6 recordings. I'll try it on a full pc in case it's the emulator.
Thanks for the try,
Bill
Thanks for the try,
Bill
Re: Random Audio Recording Error on Win32 Player
Thanks Klaus,
I'll Try it.
I'll Try it.
Re: Random Audio Recording Error on Win32 Player
Déjà vue?bziegler wrote:Thanks Klaus,
I'll Try it.
