Microphone record, playback in AIR html js desktop app

hi,
I want to record, save and playback the microphone audio in an HTML/JS AIR desktop app.
I can't find any examples so my code is based on AS3.
But the app crashes almost right away when the SampleDataEvent handler function is called.
Should it be in a while loop sames as AS3?
$(function(){
    var mic;
    var soundBytes = new air.ByteArray();
    $("#btnRecord").click(function(){
        mic = air.Microphone.getMicrophone();
        mic.rate = 44;
        mic.addEventListener(air.SampleDataEvent.SAMPLE_DATA, sampleEvent);
    function sampleEvent(e){
        while (e.data.bytesAvailable) {
            var sample = e.data.readFloat();
            soundBytes.writeFloat(sample);
    $("#btnStop").click(function(){
        mic.removeEventListener(air.SampleDataEvent.SAMPLE_DATA, sampleEvent);
        $("#txtActivity").val("");
    $("#btnPlay").click(function(){;
        for (var i = 0; i < 8192 && soundBytes.bytesAvailable > 0; i++) {
            var sample = soundBytes.readFloat();
            e.data.writeFloat(sample);
            e.data.writeFloat(sample);
            //we write the data twice because there are 2 channels (stereo)
thanks,
Jeff.

this works on my macbook. But on my Windows 8.1 machine the audio gets played back twice as slow as normal.
Not a lower pitch, just twice as slow. Any idea why this is?
$(function(){
    var s;
    var sc;
    var nowRecording = false;
    var nowPlaying = false;
    var recordedBytes = new air.ByteArray();
//   air.SoundMixer.audioPlaybackMode = window.runtime.flash.media.AudioPlaybackMode.VOICE
    var mic = air.Microphone.getMicrophone();
    mic.rate = 44;
    mic.gain = 70;
    mic.setSilenceLevel(0);
    $("#btnRecord").click(function(){
        if (!nowRecording) {
            air.trace("recording");
            recordedBytes.clear();
            mic.addEventListener(air.SampleDataEvent.SAMPLE_DATA, getMicAudio);
            nowRecording = true;
            $(this).val("Click me to stop")
        else {
            air.trace("recording stopped");
            mic.removeEventListener(air.SampleDataEvent.SAMPLE_DATA, getMicAudio);
            nowRecording = false;
            $(this).val("Click me to record")
    function getMicAudio(e){
        recordedBytes.writeBytes(e.data);
    $("#btnPlay").click(function(){
        if (!nowPlaying) {
            air.trace("playing");
            recordedBytes.position = 0;
  s = new air.Sound();
            s.addEventListener(air.SampleDataEvent.SAMPLE_DATA, playAudio);
  sc = new air.SoundChannel
            s.play();
           sc.addEventListener(air.Event.SOUND_COMPLETE, stopPlayback, false, 0, true);
            nowPlaying = true;
          //  $(this).val("Click me to stop playing")
        else {
            sc.stop();
            stopPlayback();
    function stopPlayback(e){
        air.trace("playing stopped");
        s.removeEventListener(air.SampleDataEvent.SAMPLE_DATA, playAudio);
        nowPlaying = false;
    function playAudio(e){
  if(!recordedBytes.bytesAvailable > 0)
  return;
        for (var i = 0; i < 8192; i++) {
            var sample = 0;
  if(recordedBytes.bytesAvailable > 0) sample = recordedBytes.readFloat()
            e.data.writeFloat(sample);
            e.data.writeFloat(sample);

Similar Messages

  • How do we download adobe air and pdf desktop app

    How do I save a Power Point document as a PDF?

    To convert a PowerPoint file to a PDF, you'll need either our CreatePDF service or our desktop application, Adobe Acrobat.

  • Is there a video recorder on iPad air

    Is there a video recorder on iPad air iOS 7

    The Camera app does both still photos and videos. http://help.apple.com/ipad/7/#/iPad99b53a71

  • Namespace problem while updating a desktop app

    Hello,
    I've searched on a lot of forums but didn't find anything accurate on my problem.
    I have an old AIR 2.0 desktop app that updated itself.
    I want to update it to the last 3.4 framework. So I followed instructions for the intermediate application to update (between 2.0 and 2.5).
    I manage to update from 2.0 to a Air 2.5 intermediate application, while still having the 2.0 namespace in the app descriptor file.
    But it is impossible for me to update this 2.5 application (with 2.0 namespace) to a 2.5 namespace !!
    Here si my update descriptor file :
    <?xml version="1.0" encoding="UTF-8"?>
    <update xmlns="http://ns.adobe.com/air/framework/update/description/2.5">
               <versionNumber>0.3.2</versionNumber>
               <versionLabel>Version for 0.3.2</versionLabel>
         <url>http://www.mywebsite/app.air</url>
         <description><![CDATA[
    Final test
               ]]></description>
    </update>
    But I'm having the error 16831 : "Application namespace and update.xml namespace are not compatible".
    It seems that my application only wants to update to another one with the exact same namespace.
    How this can be ?
    Thanks !
    I must say that I publish to AIR 2.5 with Flash CS5 and flashpro extension for air (in beta version) as Flash CS6 always overwrite the app descriptor while publishing (so it is impossible to change the namespace to 2.0 for example)

    Ok, after having searched a lot, I managed to understand what was going on....
    To those interested, the update descriptor must stay in a 1.0 namespace until the end of the process.
    When all is updated (app namespace to 2.5), you can use the 2.5 update descriptor namespace....

  • Cisco desktop administrator Services Configuration Multiline, Monitoring & Recording Remove VoIP/Recording & Playback Services

          I remove default VOIP Monitor Service in "Cisco desktop administrator>Services Configuration > Multiline, Monitoring & Recording >Remove VoIP/Recording & Playback Services". Now I can't choose in  "Services Configuration > Multiline, Monitoring & Recording > VoIP Monitoring Device" Default VOIP Monitor Service. How can I return choice my VOIP Monitor Service(IP UCCX)?     

    Hi Kalitamih,
    This can be regenerated by the Cisco Desktop VOIP Monitor Service.
    Please stop the service and start it (do not restart). Let me know how it goes and if it resolves the problem.
    Regards,
    Arundeep

  • Local recording playback through desktop app

    I have noticed that you lose some functionality in recorded meetings that are played back locally through the desktop application. Most notable is that you can not download a file from the file sharing pod when played back locally. A few customers have asked me about this and I am not sure how to answer them. Is this an intentional limitation for security reasons, a bug, or just a feature that didn't make into the shipping version? Are there any other recording playback features that are disabled in a local playback?
    Thanks,
    John

    I just tested as follows:
    1. I enabled on my server the option to allow users to download recorded content
    2. I created a meeting, added the file share pod, then turned on recording, turned off recording
    3. Went to my Adobe Connect Central, recordings for that meeting, edited the options to allow this to be downloaded locally, then made available for offline and made it public
    4. Downloaded the content, ran the recording
    5. I was able to select a file in the file pod and download that file to my local drive as normal
    It appears to be working fine on my server and client.
    Heyward

  • AIR HTML+JavaScript app vs. hardware accelerated composing

    I'm developing an HTML application for mobiles and desktops. The application is optimized for WebKit based environment. To improve a rendering speed I'm using hardware accelerated layers (something like -webkit-transform: translateZ(0); etc...).
    This works great on my iOS devices (using PhoneGap aka Cordova to package a "native" app).
    On Windows and OS X I'm using Adobe AIR 3.5 to package a captive runtime HTML/JavaScript based application. I have found this to be the best solution (for now) even though I have tried many others (Cordova for Windows 7 / OS X, TideSDK, ...).
    The point is that the HTML rendering in Adobe AIR seems not to be hardware accelerated. Does anyone of you have experience with this? Is here any possibility to enable hardware accelerated layers in AIR HTML rendering?
    Thanks a lot

    Thanks a lot, actually I tried AIR SDK 3.6 yesterday and it seems it still doesn't support an acceleration. In a browser it works just fine even in fullscreen (zoomed page). It seems that the best way to achieve my goal will be using Cordova wrappers for OS X and Win Desktop. But as an AIR developer I really want to use AIR SDK So I will do some more tests..
    Thanks,
    Pavel

  • How do I mute the microphone on a MacBook Air?

    How do I mute the Microphone on a MacBook Air?
    I am using a converting program and a USB turntable to convert my vinyl record to CD for my personal use.  During the recording session, environmental noise/room noise gets recorded at the same time via the built in microphone.  Is there anyway to mute this microphone or disable it?  I could do that on my old Toshiba with its Window program.
    Nantais

    Turn the input volumn down all the way for the Mic. You do that in the Sound Applet In System Preferences.

  • AS3 Workers in Air HTML Environment?

    Hi there,
    I've begun to look into the practicality of running AS3 workers in my JavaScript based desktop AIR project.  While I have not successfully nailed down a working implementation, it would seem that this is possible. 
    However, am I right to assume that I would not be able to leverage the WebKit HTML environment from within a worker?
    Lastly, is anyone actually using AS3 workers within a AIR HTML environment?  It seems to be an entirely unspoken feature within this context.  It it not documented because this is just not possible?
    Thanks,
    Mike

    Hi,
    I've been doing some work trying to get an AS3 worker running from the webkit enviroment and am having a really strange problem.  As soon as I start the worker, the worker starts chewing through all available CPU.  No messages are being passed, it has just been started.
    Here is an example of the worker:
    package DDX
         import flash.events.Event;
         import flash.system.MessageChannel;
         import flash.system.Worker;
         public class Worker
              private var mainToBack:MessageChannel;
              private var backToMain:MessageChannel;
              public function Worker()
                   var current:flash.system.Worker = flash.system.Worker.current;
                   mainToBack = current.getSharedProperty("mainToBack");
                   backToMain = current.getSharedProperty("backToMain");
                   mainToBack.addEventListener(Event.CHANNEL_MESSAGE, onMainToBack);
              private function onMainToBack(event:Event):void
                   if (mainToBack.messageAvailable) {
                        var msg:* = mainToBack.receive();
                        if (msg == "SOLVE") {
                             backToMain.send("SOLVED");
    And here is how I set it up in JavaScript:
    var workerLoader = new air.URLLoader(),
        mainToBack,
        backToMain,
        bgWorker,
        workerBytes;
    workerLoader.dataFormat = air.URLLoaderDataFormat.BINARY;
    workerLoader.addEventListener(air.Event.COMPLETE, function(event) {
        workerBytes = event.target.data;
        bgWorker = air.WorkerDomain.current.createWorker(workerBytes);
        mainToBack = air.Worker.current.createMessageChannel(bgWorker);
        backToMain  = bgWorker.createMessageChannel(air.Worker.current);
        backToMain.addEventListener(air.Event.CHANNEL_MESSAGE, function() {
            if (backToMain.messageAvailable) {
                var msg = backToMain.receive();
                console.log('RECEIVED ' + msg);
        }, false, 0, true);
        bgWorker.setSharedProperty("backToMain", backToMain);
        bgWorker.setSharedProperty("mainToBack", mainToBack);
        // listen for worker state changes to know when the worker is running
        bgWorker.addEventListener(air.Event.WORKER_STATE, function(e) {console.trace(e)});
    workerLoader.load(new air.URLRequest("assets/flash/DDXWorker2.swf"));
    As soon as I start the worker, CPU starts being eaten up entierly:
    bgWorker.start();
    No messages being sent via the channel, just the worker started.
    Any ideas?
    Thanks,
    Mike

  • Is there a way to download inside AIR HTML?

    Hi,
    Is there any way to download files from the webpage running inside AIR HTML component? i.e. mail attachment etc.?
    Thanks!

    I'm already overriding loaded HTML page's links etc. but yes its true to determine which link is for download or to open just a web page.
    StageWebView!! I was in impression for a long time, this made for mobile! After you saying so, at help.adobe.com I can see this also for all desktop operating systems too! Great!
    Though our existing ol' HTML component is already coded/modified heavily through the application, I don't know how far we can replace them with new StageWebView.. but you simply given me an option. Thanks!
    I'll see a simple demo how enable it is downloading files in an AIR application, shortly.

  • T60 soundmax built in microphone records all the time, again! Vista

    When using Audacity 1.2.6 and source set to "stereo mix", the soundmax drivers are again constantly mixing the microphone into the streaming audio, or other sound playback, such as VLC playing an .mp3 file.
    When using Audacity 1.3.13 there is no "stereo mix" option to choose from, and again microphone is always recording when recording streaming media or other sound playback.
    Using microsoft update this last week, for some reason microsoft has removed the 2009 update which corrected this problem.  Microsoft update says the 2007 drivers are now the latest soundmax drivers for my computer, and has changed them back.
    I can't roll back or forward to the 2009 update.  I did not do any manual changes, all updates from microsoft are set to automatic.
    Audacity only uses the system drivers, this is not their programs fault, this is a driver fault between vista and soundmax
    please fix ASAP as my compute is now useless to me until its fixed!
    BTW turning on stereo mix from Vista did not fix the probem, the microphone records even under selecting the input to CD.   If I mute the microphone, then there is no sound input under any input setting.

    hey midnightvisions,
    uninstall the current audio drivers that you have. let windows install its generic drivers.
    then test with audacity and see if you're able to use it as how it should be.
    later on, visit http://support.lenovo.com and update your audio drivers accordingly
    WW Social Media
    Important Note: If you need help, post your question in the forum, and include your system type, model number and OS. Do not post your serial number.
    Did someone help you today? Press the star on the left to thank them with a Kudo!
    If you find a post helpful and it answers your question, please mark it as an "Accepted Solution"!
    Follow @LenovoForums on Twitter!
    Have you checked out the Community Knowledgebase yet?!
    How to send a private message? --> Check out this article.

  • HT204089 I have a samsung smart TV and record free to air TV shows on my TVO I would like to purchase from iTunes a TV series called outlander but do not know how to transfer and save the episodes on my TIVO I will be using my iPad to purchase and downloa

    I Have a  samsung smart TV  and use TVO to record  free to air programmes .
    i would like to purchase from iTunes using my iPad , a TV series called outlander but do not know how to transfer and save the episodes to my TIVO
    please help

    Many videos in the iTunes store are protected so that they can only be viewed on Apple Devices signed into your iTunes account.  If that is the case then your TiVo will not be able to read the files.  If you know how to get a video file onto your TiVo from a flash drive, then just plug a flash drive into your Mac and drag one of the videos from inside the iTunes window onto the icon for the flash drive on your Desktop or in the left sidebar of a Finder window.  That will copy the actual file onto the flash drive. 

  • I'm on an language educational website that is powered by Adobe Flash. There is a feature on the site where you talk, and the website's microphone records you.

    I'm on an language educational website that is powered by Adobe Flash. There is a feature on the site where you talk, and the website's microphone records you. Unfortunately, I get an "Adobe Flash Player Settings" module when opening it, and I'm unable to click the allow button-or anything on the screen. Help? Below is a screenshot.
    This question was archived but I was having the same problem but was able to fine the solution.

    You go to the link below
    http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager.html
    1. Select Global Security Settings
    2. Select Always ask
    I then reopened Firefox and videos worked with a problem

  • Error Installing Adobe Air from Story Desktop Application Installer

    This is truly driving me nuts already.
    Every time I try to install the Desktop Application from the Story website, it says I must install Adobe Air. So I click Install, it shows the progress bar to 100%, then errors out with a window. The window header reads "Adobe AIR Installer" and the main section of the window reads "Couldn't write the application to the hard disk. Please verify the hard disk is available and try again." - There is a Retry and Cancel. Retry does it all again with same results.
    No, I had no previous versions of Adobe Air. So I tried installing AIR direct from the Adobe website, and it installs fine. So I go back to the Story webpage and try installing the Desktop Application again and the exact same set of events as described above happens. I uninstalled the AIR install, tried again, same result.
    I had Production Premium CS3 previously, and installed Production Premium CS5 UPGRADE. All the programs in the suite work like a charm!
    I'm running Windows 7 64 bit with 208 Gig free on my C drive, as well as over 500 gig free spread out over two other drives. 8 Gig memory, and two Nvidia Qadro FX 3500 video cards (If that matters at all). Full admin rights to the PC, not limited in any way.
    A quick Google search shows plenty of other people having the same problem,  just no known fixes I've found!
    HELP!!!
    PS- I have a picture of the error message, but the insert picture link is greyed out and won't let me add anything to this post.

    Here is the installer log entries as requested:
    9/3/10 11:34:54 AM /Applications/Utilities/Adobe AIR Application Installer.app/Contents/MacOS/Adobe AIR Application Installer[344] Starting app install of file:///Users/Shared/Downloads/AdobeStory.air
    9/3/10 11:34:54 AM /Applications/Utilities/Adobe AIR Application Installer.app/Contents/MacOS/Adobe AIR Application Installer[344] UI SWF load is complete
    9/3/10 11:34:55 AM /Applications/Utilities/Adobe AIR Application Installer.app/Contents/MacOS/Adobe AIR Application Installer[344] UI initialized
    9/3/10 11:34:55 AM /Applications/Utilities/Adobe AIR Application Installer.app/Contents/MacOS/Adobe AIR Application Installer[344] beginning UI styling
    9/3/10 11:34:55 AM /Applications/Utilities/Adobe AIR Application Installer.app/Contents/MacOS/Adobe AIR Application Installer[344] UI styling complete
    9/3/10 11:34:55 AM /Applications/Utilities/Adobe AIR Application Installer.app/Contents/MacOS/Adobe AIR Application Installer[344] Unpackaging to /private/var/folders/dJ/dJl0jNt6GK4MiC2esOh-GU+++TM/TemporaryItems/FlashTmp0
    9/3/10 11:34:58 AM /Applications/Utilities/Adobe AIR Application Installer.app/Contents/MacOS/Adobe AIR Application Installer[344] unpackaging/validation is complete
    9/3/10 11:34:58 AM /Applications/Utilities/Adobe AIR Application Installer.app/Contents/MacOS/Adobe AIR Application Installer[344] application is bound to this version of the runtime
    9/3/10 11:34:58 AM /Applications/Utilities/Adobe AIR Application Installer.app/Contents/MacOS/Adobe AIR Application Installer[344] app id com.adobe.AdobeStory
    9/3/10 11:34:58 AM /Applications/Utilities/Adobe AIR Application Installer.app/Contents/MacOS/Adobe AIR Application Installer[344] pub id 4875E02D9FB21EE389F73B8D1702B320485DF8CE.1
    9/3/10 11:34:58 AM /Applications/Utilities/Adobe AIR Application Installer.app/Contents/MacOS/Adobe AIR Application Installer[344] Application located at /Applications
    9/3/10 11:34:58 AM /Applications/Utilities/Adobe AIR Application Installer.app/Contents/MacOS/Adobe AIR Application Installer[344] The certificate of the installed app fails to match either the signature or migration signature of the AIR file
    9/3/10 11:35:01 AM /Applications/Utilities/Adobe AIR Application Installer.app/Contents/MacOS/Adobe AIR Application Installer[344] starting cleanup of temporary files
    9/3/10 11:35:02 AM /Applications/Utilities/Adobe AIR Application Installer.app/Contents/MacOS/Adobe AIR Application Installer[344] application installer exiting
    9/3/10 11:35:02 AM /Applications/Utilities/Adobe AIR Application Installer.app/Contents/MacOS/Adobe AIR Application Installer[344] application installer exiting
    9/3/10 11:35:02 AM com.apple.launchd[223] ([0x0-0x40040].com.adobe.air.ApplicationInstaller[344]) Exited with exit code: 9
    Thank you for your help.

  • Help Needed - My BB 8520 Curve has this message-CRTranRec::GetLinkedRecordID:Invalid linked record id while sychronisation using the desktop software

    Hi!
    Need some help with the same:
    Help Needed - My BB 8520 Curve has this message-CRTranRec::GetLinkedRecordID:Invalid linked record id while sychronisation using the desktop software

    Hi sameer197301 and welcome to the BlackBerry Support Community Forums!
    To clarify, are you seeing this message displayed on your BlackBerry® smartphone or on your computer?
    Thanks.
    -CptS
    Come follow your BlackBerry Technical Team on twitter! @BlackBerryHelp
    Be sure to click Kudos! for those who have helped you.Click Solution? for posts that have solved your issue(s)!

Maybe you are looking for