AirMicrophone-ANE This is an Air native extension aiming to replace the Microphone class on iOS. It has been developed byFovea. Notes- only support activity level monitoring for now.
- this is WORK IN PROGRESS.
InstallationThe ANE binary (AirMicrophone.ane) is located in the bin folder. You should add it to your application project's Build Path and make sure to package it with your app (more information here). UsageAPI's goal is to write the same code than if using flash's Microphone class, except that you include a different class. - import cc.fovea.ane.AirMicrophone.Microphone;
- // Initialize the microphone
- var mic:Microphone = (Microphone)(Microphone.getMicrophone());
- // All this is ignored when using the ANE. Just here for compatibility.
- mic.setLoopBack();
- mic.addEventListener(StatusEvent.STATUS, onMicStatus);
- [...]
- // Start recording
- mic.rate = 11; // (or any non-zero value)
- // Retrieve activity level
- trace(mic.activityLevel);
- // Stop recording
- mic.rate = 0;
复制代码 Build scriptShould you need to edit the extension source code and/or recompile it, you will find an ant build script (build.xml) in the build folder: - cd /path/to/the/ane
- # Setup build configuration
- cd build
- mv example.build.config build.config
- # Edit build.config file to provide your machine-specific paths
- # Build the ANE
- ant
复制代码
相关链接:
https://github.com/j3k0/AirMicrophone-ANE
|