首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在open laszlo中,getMCRef().attachAudio()的等价物是什么?

在open laszlo中,getMCRef().attachAudio()的等价物是什么?
EN

Stack Overflow用户
提问于 2012-09-22 00:49:06
回答 1查看 133关注 0票数 1

我想知道OpenLaszlo4.9中getMCRef().attachAudio()的等价物。之前,我使用此方法将音频输入获取到一个视图,以根据音频进行置换。但在最近的版本中,我尝试将其附加到精灵上,但它不起作用。有什么想法吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-09-26 03:03:10

这段代码应该可以让你上手了,它向你展示了如何在OpenLaszlo 4.9.0中从OpenLaszlo SWF8、SWF9和SWF10运行时访问闪光灯麦克风和摄像头对象:

代码语言:javascript
复制
<class name="mediamanager">

  <when property="$as3"><!-- SWF9, SWF10 -->

    <passthrough>
      import flash.media.*;
    </passthrough>

    <!---
    Gets a reference to the camera.

    @returns object: reference to the camera object.
    -->
    <method name="getMicrophone">
      return flash.media.Microphone.getMicrophone();
    </method>

    <method name="getNumMics">
      return flash.media.Microphone.names.length;
    </method>   

    <method name="getMicNames">
      return flash.media.Microphone.names;
    </method>           

  </when>

  <when property="$as2"><!-- SWF8 -->

    <!---
    Gets a reference to the camera.

    @returns object: reference to the camera object.
    -->
    <method name="getMicrophone">
      return Microphone.get();
    </method>

   <method name="getNumMics">
     return Microphone.names.length;
   </method>        

   <method name="getMicNames">
      return Microphone.names;
   </method>        

</when>

代码语言:javascript
复制
<passthrough>
  import flash.media.*;
</passthrough>

<!---
Gets a reference to the camera.

@returns object: reference to the camera object.
-->
<method name="getCamera">
  return flash.media.Camera.getCamera();
</method>

<method name="getNumCams">
  return flash.media.Camera.names.length;
</method>   

<method name="getCamNames">
  return flash.media.Camera.names;
</method>       

代码语言:javascript
复制
 <!---
 Gets a reference to the camera.

 @returns object: reference to the camera object.
 -->
<method name="getCamera">
  return Camera.get();
</method>

<method name="getNumCams">
  return Camera.names.length;
</method>

<method name="getCamNames">
  return Camera.names;
</method>

有关Flash麦克风和Camera对象的属性和方法的完整详细信息,请参阅Flash文档。此外,这不是在OpenLaszlo中访问麦克风和摄像头的官方方式,但我使用它们是因为并非所有属性都可以从OpenLaszlo摄像头和麦克API获得,如果你想使用官方API,请参阅官方类文档,网址为:

http://www.openlaszlo.org/lps4.9/docs/reference/ -“音视频”文件夹

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/12534729

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档