Record Sound, Windows and Revlets

Visuals, audio, animation. Blended, not stirred. If LiveCode is part of your rich media production toolbox, this is the forum for you.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
cborn
Posts: 66
Joined: Fri Dec 15, 2006 11:35 pm

Record Sound, Windows and Revlets

Post by cborn » Wed Jan 19, 2011 10:39 pm

So I've made an audio recorder revlet. It works quite well on Macintosh (as you can expect), but it quite unstable on Windows. I've been told several times that the Windows RevWeb Plugin will be updated any time now, but updates have not yet come out.

The behavior I see in some Windows environments is that the first call to record sound file hangs for 3-4 seconds and doesn't produce a usable file. However, if you call record sound file a second time, it seems to work well (i.e. it crashes less often). This makes me think that QT needs some kind of initialization in the background before being ready to perform the record function. Does anyone know 1) if that is true, and 2) how I might build such initialization into the opencard script so that it's ready to record when needed?

I have a lot of Mac users, but the Windows users would really like to use this on their own computers. Any help or advice is appreciated.

carly

cborn
Posts: 66
Joined: Fri Dec 15, 2006 11:35 pm

Re: Record Sound, Windows and Revlets

Post by cborn » Wed Jan 19, 2011 10:44 pm

BTW, the same code exported to a Windows standalone behaves the same way.

Win XP SP3, QT 7.6.9

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4163
Joined: Sun Jan 07, 2007 9:12 pm

Re: Record Sound, Windows and Revlets

Post by bn » Thu Jan 20, 2011 12:03 am

Hi Carly,

I use the QTversion to initialize Quicktime in a openstack handler.
I just say

Code: Select all

  put   QTversion () into x -- to preload Quicktime 
where x is just a dummy variable.

The reason is laid out in the dictionary for QTversion:
Tip: It can take Revolution a second or two to load the code needed to use QuickTime, depending on the machine speed. Since this code is only loaded into memory once per session, you can speed up the first occurrence of a QuickTime-related action by calling the QTVersionfunction during otherwise dead time--for example, during startup of your application--to preload the code.
I don't know if this helps but from what you describe this just might be a problem of Quicktime initialisation. At least worth a try. And it might be that on a Mac Quicktime is more accessible than on a Windows machine, where Quicktime has to be loaded first.

Kind regards

Bernd

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4163
Joined: Sun Jan 07, 2007 9:12 pm

Re: Record Sound, Windows and Revlets

Post by bn » Thu Jan 20, 2011 1:07 am

Hi Carly,

coming to think of this the above of course only would possibly apply if you are using Quicktime for recording on Windows...

If on windows you use another multimedia system you might ask support at runrev dot com whether there is some sort of "initialization" for that system if no one comes up with a betther solution.

Kind regards

Bernd

cborn
Posts: 66
Joined: Fri Dec 15, 2006 11:35 pm

Re: Record Sound, Windows and Revlets

Post by cborn » Thu Jan 20, 2011 3:25 pm

Bernd,

Brilliant, as always! Yes, I'm using QT for recording for the moment. But am thinking of switching methods for the different platforms. But then handling the files on the server gets interesting if they are in different formats. So I haven't decided yet.

I'll try this out and see how it goes!

cborn
Posts: 66
Joined: Fri Dec 15, 2006 11:35 pm

Re: Record Sound, Windows and Revlets

Post by cborn » Thu Jan 20, 2011 9:14 pm

Unfortunately, QTVersion did not seem to make a difference. It still seems that there is a delay on the initial call to the record sound file button, no matter what else is loading early on. In fact, hitting any button first seems to wake up the revlet. I may try to embed a call to one of the buttons that doesn't do much of anything but wake up the revlet and see if that gets me anywhere.

The RevWeb Plugin is still crashing with some regularity, though, so I don't have high hopes. I think the bulk of the problem lies there. It sure would be nice to know when that would be updated again so I can finally move to LC 4.5!

cborn
Posts: 66
Joined: Fri Dec 15, 2006 11:35 pm

Re: Record Sound, Windows and Revlets

Post by cborn » Thu Jan 20, 2011 11:53 pm

I retract my previous post.

If I build the revlet from a Windows computer running LC 4.5.3, then the QTVersion() does have an immediate effect.

I had previously been building from RR 4.0 on my Mac. I've been afraid to upgrade to LC given that the RevWEb Plugin has not yet been updated. But perhaps I will need to. I just don't want it t break anything else!

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4163
Joined: Sun Jan 07, 2007 9:12 pm

Re: Record Sound, Windows and Revlets

Post by bn » Fri Jan 21, 2011 2:21 pm

Hi Carly,

glad to hear that something is working...

I wonder if you were not running into caching problems when rebuilding the revlet. Always something to consider. The browsers do cache stuff like that.

Actually they did change some stuff for the recording in the 4.5.x, had something to do with preferences for sound recording, as far as I remember. Might also been of help in your case although the revlet itself is not updated.

Please tell us whether the crashing of the revlet in windows is less frequent and if you can actually use the revlet for your project on Windows.

Kind regards

Bernd

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Record Sound, Windows and Revlets

Post by Klaus » Fri Jan 21, 2011 2:37 pm

Hi all,

hmmmm, some time ago I reported that querying the QTVersion() would already load QuickTIme,
which made it impossible to decide to NOT use QuickTime on Windows if the version is too low or whatever!
When QuickTime has been loaded, it cannot be unloaded, except with a QUIT and restart of that app.

If I remember right, the dev team changed this, so querying the QTVersion() should in fact NOT preload QuickTime! :?:


Best

Klaus

P.S.
I just checked this in the Quality Center and looks like I remember right:
http://quality.runrev.com/qacenter/show_bug.cgi?id=1949
#####
...
------- Comment #12 From Mark Waddingham 2007-09-06 10:31:44 [reply] -------
Fixed in 2.9.0-dp-1.
#####

But I did not really test this on Windows so far...

cborn
Posts: 66
Joined: Fri Dec 15, 2006 11:35 pm

Re: Record Sound, Windows and Revlets

Post by cborn » Fri Jan 21, 2011 6:01 pm

From reading the bug report comments it kind of sounds like what was fixed was the ability to call dontuseqt after having called QTVersion(). I might be misreading.

Anyway, my recording revlet is behaving better having made this change and then compiled on Windows. But the plugin itself is still unstable. :cry:

Tomka
Posts: 59
Joined: Mon Apr 18, 2011 7:30 pm

Re: Record Sound, Windows and Revlets

Post by Tomka » Wed May 18, 2011 7:01 pm

Hi,

think I got the same problem still in v4.6.1. Anyone tried to play a "empty" soundfile via player-object a earlier card/stack before the record-function is used? Maybe its a safe way to load QT in memory?

best
Thomas

cborn
Posts: 66
Joined: Fri Dec 15, 2006 11:35 pm

Re: Record Sound, Windows and Revlets

Post by cborn » Thu Jul 14, 2011 9:44 pm

Thomas,

Did that method work for you? I've been still racking my brain on how to make QT initialize faster on Windows. Have you learned anything new? :?:

Post Reply