2017-01-05 107 views
1

我正在使用Livecode Community 7.0.4,我试图创建一个音频。我想在windows 10如何在Livecode中录制音频?

我创建了three按钮recordstopplay

而且每个按钮上我有这些代码:

//record 
on mouseUp 
    record sound test.wav 
end mouseUp 

//stop 
on mouseUp 
    stop recording 
end mouseUp 

//play 
on mouseUp 
    play test.wav 
end mouseUp 

但这些都不工作。没有生成音频文件。

什么应该是正确的做法呢?

对于record,我也试过这段代码,但结果相同。

on mouseUp 
    set the dontUseQT to false 
    record sound test.wav 
end mouseUp 

回答

1

对于初学者,您忽略了关键字file

record sound file "test.wav" 

下面是更完整的答案。目前,只有当您的系统上安装有QuickTime for Windows时,才能进行录音。请务必首先将录制属性设置为您想要的。正确的语法是:

set the recordFormat to "wave" 
set the recordCompression to "raw " # note trailing space 
set the recordSampleSize to 16 # bit depth 
set the recordRate to 44.1 # sampling rate 
set the dontUseQT to false 
record sound file "C:/path/to/file/test.wav" 

音频记录框架被完全重写,并将于某时在LC V 9系列。 (v.9的初始alpha版本现在已经出来。)这将删除音频记录的QuickTime依赖项。

+0

谢谢@Devin,我会试试看。 – JunM

+0

这看起来很有前途,但仍然无法正常工作。我会尝试更新我的QuickTime,如果有任何奇迹:) – JunM

+0

我发现了这个问题。这是LC 7.0.4上的一个错误,在使用LC 7.1.4后现在工作正常 – JunM