Problem with microphone on iOS - bug or bad code?

Hi all

It seems that the use of the micro class freezes my Flex app. I provided the code below, but here is an overview:

  • This only happens on iOS - specifically my iPhone 4. I have not seen this problem on Android devices.
  • My code alternated recording and records don't not - 5 seconds to one, then 5 seconds of each other, then repeat over and over again.
  • I have reduced this to a 'minimum' example (see code below) which does this. It does not use data etc. coming the Microphone is not create or fill a ByteArray.
  • The application always crashes. In some cases, this happens when he worked only 2-3 minutes, in all cases, it happens in half an hour. I did 10 sets of tests and the average is 15 minutes.

My application is a language learning app and recording and playback of the voice of the user is an important feature. It allows the user to hear how their pronunciation matches that of a native speaker. When recording / reading is marketed the software repeatedly plays a few sound recordings, the voice of the user, it reads, the more audio plays, etc.. In other words, it includes features similar to the minimal case code I included here. Users often use this feature 30 minutes or more. It is therefore a problem.

I'm doing something wrong in my code? Just checking before I report it as a bug.

You can download an FXP from here if you are interested:

http://www.Brightworks.com/downloads/RecordingTest.FXP

Alternatively, the important code is below. This is the display (only) of the sample application.

Thank you

Douglas

Douglas McCarroll

Brightworks, Inc.

320.300.0220

<? XML version = "1.0" encoding = "utf - 8"? >

< s:View xmlns:fx = " " http://ns.Adobe.com/MXML/2009 "

xmlns:s = "library://ns.adobe.com/flex/spark".

creationComplete = "onCreationComplete().

title = "Test recording" >

< fx:Declarations >

< / fx:Declarations >

< fx:Script >

<! [CDATA]

private var _isRecording:Boolean;

private var _iterationCount:uint = 0;

private var _microphone:Microphone;

private var _recordedSeconds:uint = 0;

private var _timer:Timer;

private function onCreationComplete (): void

{

NativeApplication.nativeApplication.systemIdleMode = SystemIdleMode.KEEP_AWAKE;

}

private void doNextPhase(event:TimerEvent_=_null):void

{

_isRecording =! _isRecording;

If (_isRecording)

{

_iterationCount ++;

displayOutput ("Recording");

_microphone = Microphone.getMicrophone ();

_microphone.rate = 44;

_microphone.gain = 50;

_microphone.setSilenceLevel (0, 2000);

_microphone.addEventListener (SampleDataEvent.SAMPLE_DATA, onNewRecordingSampleData);

}

on the other

{

_recordedSeconds += 5;

displayOutput ("Pausing");

_microphone. RemoveEventListener (SampleDataEvent.SAMPLE_DATA, onNewRecordingSampleData);

_microphone = null;

}

}

private void onNewRecordingSampleData(event:SampleDataEvent):void

{

}

private void displayOutput(phase:String):void

{

var freeMemoryMB:int = Math.round (System.freeMemory / (1024 * 1024));

var privateMemoryMB:int = Math.round (System.privateMemory / (1024 * 1024));

var totalMemoryNumberMB:int = Math.round (System.totalMemoryNumber / (1024 * 1024));

phaseLabel.text = "Phase:"+ phase; "

iterationLabel.text = "iteration:"+ _iterationCount; "

recordedSecondsLabel.text = ' seconds saved: "+ _recordedSeconds;"

freeMemoryLabel.text = "System.freeMemory MB:"+ freeMemoryMB; "

privateMemoryLabel.text = "System.privateMemory MB:"+ privateMemoryMB; "

totalMemoryNumberLabel.text = "System.totalMemoryNumber MB:"+ totalMemoryNumberMB; "

}

private function startTimer (): void

{

_Timer = new Timer (5000, 0);

_Timer.addEventListener (TimerEvent.TIMER, doNextPhase);

_Timer.start ();

}

private function onStartRecordingButtonClick (): void

{

If ((Microphone.getMicrophone ()))

{

startRecordingButton.enabled = false;

startTimer();

doNextPhase();

}

on the other

{

phaseLabel.text = 'No Mic' available;

}

}

[]] >

< / fx:Script >

< s:VGroup height = "100%".

Width = '100% '.

paddingBottom = "20".

paddingLeft = "20".

paddingRight = "20".

paddingTop = "20" >

< s:Label id = "phaseLabel".

Width = "100%" / >

< s:Label id = "iterationLabel".

Width = "100%" / >

< s:Label id = "recordedSecondsLabel".

Width = "100%" / >

< s:Label id = "freeMemoryLabel".

Width = "100%" / >

< s:Label id = "privateMemoryLabel".

Width = "100%" / >

< s:Label id = "totalMemoryNumberLabel".

Width = "100%" / >

< / s:VGroup >

< s:HGroup width = '100% '.

horizontalAlign = "center".

Low = "10" >

< s:Button id = "startRecordingButton".

label = "Start Recording"

a click = "onStartRecordingButtonClick()".

Width = "60%" / >

< / s:HGroup >

< / s:View >

The problem has been resolved with 3.8.0.730!

http://forums.adobe.com/message/5399512#5399512 ;-)

Thank you Adobe!

Tags: Adobe AIR

Similar Questions

  • I encountered the problem with the last iOS 9.3.2 update I can't receive call from people, I can call any body, but when l'm calling people any body can ring me just now, I thing the problem where new soft

    I encountered the problem with the last iOS 9.3.2 update I can't receive call from people, but I can call any body, but when l called people any body can ring me only at this time, I think that the problem of the new update. can u check this and answer my question.

    and my phone

    iPhone 6plus

    You see a Crescent Moon at the top of the screen icon? If Yes, disable does not bother to: settings - do not disturb = Off.

  • Problems with updating creative cloud to desktop. (error code: 2)

    Problems with updating creative cloud to desktop. (error code: 2)

    Hi Mike,.

    You can follow the article: error: "unable to install". Creative Cloud Desktop that will help you get your number sets.

    Alternatively, you can follow the thread: Creative Cloud desktop could not be updated. () Error code: 2) where this issue is already addressed.

    Let us know if it works or not.

    Thank you

    Yann Arora

  • problems with ipod touch ios 9.3.2 and gen 6

    I own an iPod Touch generation 6 with 32 GB.  My PC is a Windows 7 PC.  My iTouch is looking forward to start a SOFTWARE iOS 9.3.2 UPDATE.

    I heard that there are "problems" with iOS 9.3.2.  I have not read that they affect the iPod Touch.  But who reads everything?

    Should I go ahead and update my iOS?   Or should I wait for iOS 9.3.3 or a new iOS 9.3.2?

    AND Apple should fix the editor of this Post, it *.

    I have a 6th gen iPod on 9.3.2 and it works fine

    The only devices with problems were iPad 9.7 Pro

  • Re: Problems with Microphone when I use Skype

    Could anyone help with the problems I am experiencing with the microphone when using Skype?
    I also tried to use an external, but still problems with the other person can't hear me, y at - it a setting I can adjust its been to Toshiba and they said that there is no fault.

    Any help would be appreciated.

    In fact internal mic works well with Skype.
    All you need to do is enter the sound options of Skype and check the settings there especially if you use the headset.
    Play around with these settings.

  • Satellite A205-SP5820 - problem with microphones

    Hello

    I have a Toshiba Satellite A205-SP5820, and it's been almost two months that my microphone stopped working (external & the built). Today, I installed three different drivers (the one downloaded from softonic, one page Web from Toshiba and the other from Realtek)
    They still do not work.

    What can I do?
    Thank you.

    That really strange, you have this problem with the internal and external microphone.
    The configuration of the laptop is not known to me, but if you have tried the mixture of different drivers I don't think it is unique to the pre-installed driver.

    I think that best option for you will be clean OS installation but using the Toshiba recovery image you have with your laptop. Toshiba recovery image contains fine work and drivers tested so if the problem will still be there, it can be hardware only question about.

    Clean OS installation option is right for you?

  • Problem with microphone recording in Windows 7

    Original title: problem with the microphone

    Sir my drivers are perfectly fine but my microphone does not work and my default set and apply the buttons are grayed out in the record of devices.when im trying to put my problem its evrything saying isn't alrght theres no problem in my drivers... when im recording my voice, I found another seems not my voice... what should I do Sir

    Hello

    1 - is a built-in microphone? If Yes, what is the brand and model of the computer?

    If not, then what is the brand and model of the Microphone?

    2 did you recent hardware or software changes to your computer before this problem?
    3. what applications do you use to make use of the Microphone?
    4. are you able to record sounds using the sound recorder?

    5. what exactly do you mean when you say an different sound and not my voice?

    I suggest you to follow the steps and check if it helps.

    Method 1:

    Try to run the Audio recording utility and check if it helps.

    http://Windows.Microsoft.com/en-us/Windows7/open-the-recording-audio-Troubleshooter

    Method 2:

    I suggest you to check if the microphone is set as default as playback devices.
    a. click Start, type Sound in the area start search.
    b. click on his research at the top of the start menu.
    c. click the Read tab. Notice the check mark next to the default device. For most users, the default device is speakers. Make sure that the audio settings are configured as expected. Follow these steps:
    d. on the Read tab, select the playback device, click Properties, click the Advanced taband make sure that the default Format is set to the value you expect. When you are finished, close this window to return to the previous window.
    e. on the Read tab, select the playback device, click set upand make sure that the configurations are set correctly.
    f. Select the audio device you want as default audio deviceand then click on set default.
    g. click OK to save your settings and close the sound dialog box.

    Hope this helps and keep us posted.

  • Problem with DVD player and get the error code 19 Device Manager

    Original title: TSSTcorp CDDVDW SH - 224DB ATA device

    Windows cannot start this hardware device because its information of configuration (in the registry) is incomplete or damaged. (Code 19)

    How to fix it please Message Please please how to fix it

    Hi Emerald,

    Please contact Microsoft Community. I understand that you have a problem with the CD\DVD drive and get the error code 19 Device Manager. I've surely you will help solve this problem.

    To better understand the issue, I would like to know if you have any recent software or hardware on the computer changes before this problem?

    This problem might have occurred because of these reasons:

    1. Install or uninstall the CD or DVD recording programs.
    2. Uninstall Microsoft Digital Image.

    Try the steps listed here and see if it helps:

    I suggest you try the procedure described in article which will correct corrupted registry entries. Check if it helps.

    Your CD-ROM or DVD drive is not recognized by Windows or other programs
    http://support.Microsoft.com/kb/314060/en-us

    Note: This section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information on how to back up and restore the registry, click on the number below to view the article in the Microsoft Knowledge Base:

    Hope this information helps. Reply to the post with an up-to-date report of the issue so that we can help you further.

  • Problems with the windows troubleshooting utility. Error code: 0 x 80070002

    Original title:

    Problems with the windows troubleshooting tool

    Whenever I run the Troubleshooting Guide for things like a problem of wireless network I get this error

    An error occurred during troubleshooting:
    An unexpected error has occurred. The Troubleshooting Wizard can not continue.
    Identifier of the package: PeformanceDiagnostic
    Path: No Local package
    Error code: 0 x 80070002
    Source: engine
    User: SCOTTSLAPTOP\Scott
    Background: high

    Hello

    1. the problem occurs with all the troubleshooters you trying to run?
    2. why you try to run the troubleshooter?

    3. Since when are you facing this problem?

    Note:
    You can back up data to an external hard drive and no CD. It is essential to back up data even if you do an inplace upgrade.

    You can try to do an inplace upgrade and check if this gives a probable solution.
    Check the following link to see how to perform an inplace upgrade.
    http://support.Microsoft.com/kb/2255099

    I hope this helps.

  • A problem with the lock 10 - Bug ios screen?

    Bug:

    Steps to follow:

    1. slide right on the lock to go to Widget screen screen

    2. scroll and click 'CHANGE '.

    3. Requests that an access code

    4. change the Widgets in the "ADD WIDGETS" screen

    5. click on done

    6. the onus is on the screen of Widgets

    7 now drag to the right and click the 'home' button the phone unlocks without asking for a pass code.


    My pass code is set to require immediately

    Everyone has the same problem?

    You already unlocked the device once and like you don't a not lock again when you changed the widgets, it remains unlocked. This is how it works on my iPad that comes, I have updated to iOS 10.

  • Problems with the update IOS 10

    Hello

    I need help.  I updated my iphone 6 more last night at 10 IOS.  The update seemed to have worked, but now I can't sign in with my password ID Apple I get an error "Self-test Failed - there is a connectin to the Apple ID server error" to come after as I try to connect.  In addition, I can't in the itunes and app store apps.  The app just itunes appears blank and the app store app wrote "loading" all the time.  In fact, I have a problem, try to get the majority of my apps work now either.

    The only thing I tried to do to fix the problem is to turn the phone on and off again.  Any suggestions please?

    Jane.

    Greetings anfield5jane,

    I see that after updating your iPhone 6 more last night at iOS 10, you are now unable to connect your Apple ID and password. You get a verification failure message. I know how it is important to ensure that you can use these applications and services.

    I suggest you force by closing the App Store and the iTunes and app reopened to see if you get the same question. The following article will help you: force a nearby application on your iPhone, iPad or iPod touch

    If you notice that helps, try to force, close other applications that have the same problem.

    I would also like to test this on Wi - Fi and cellular data to see if you get the same result.

    Please let us know what happens. We're here to help.

    Best regards.

  • Starkey Halo AIDS have problems with the new ios 9.3.1

    My hearing aids Starkey Halo need bluetooth for streaming with my iphone. Worked fine until I updated my phone to ios 9.3.1. Help! I use this function by calls, the streaming of music and audio books.

    You must contact the support of Starkey to see if their devices are optimized to work with iOS 9.3.1. They would be the ones who you explain. If this isn't the case, you may have a problem, because Apple does not support downgrading from iOS. You might also need to re-pairing after iOS update. Starkey should be able to explain that for you as well.

  • Satellite Pro P300-13i / XP SP3 / problem with microphone

    Just bought a P300-13i and a beautiful machine, it's too. It came with a XP Recovery disk for playing for a few minutes then with Vista to check all knitted OK I brought back to XP (you need to be reliable and v quickly...) I'm a "one man band") and everything seemed to go smoothly with one exception v.

    The machine is supplied with a built-in webcam and microphone. Since the downgrading to XP microphone does not at all well (poor sound volume and a lot of apparent interference) - I confirm with Vista, it worked impeccably well.

    Called Tosh who tried to get a boost function to work... but they could not find. Same re - load the driver concerned but still no result. My problem was apparently 'high', but I guess that's fancy talk for "we can not help you" because I have not heard for over a week now...

    I was wondering if there was a spark out there that may be able to help me... also borrowed USB a friend and who has worked well... but obviously bought a machine with a microphone built-in microphone, I don't want to have to lug round, a plug in mic with me as well!

    The machine is heavy enough as it is!

    Look forward to hearing from someone.

    Lindsay

    Wonderful information!
    Thanks for sharing this with us!

  • Problems with microphone? + other multimedia USB device asks :)

    Hello

    I have an Equium A60-181 and he doesn't seem to like my headset which I believe is one of these types of condenser, which needs a power supply.

    It works fine on 2 of my PC sound cards and my old laptop but not the tosh. I had a quick look in the settings of the sound card, there is no option to 'feed' the microphone. Am I to understand that they did not bother to put this feature in their microphones condenser produced portable computer are the microphones commonly used for computers?

    There is also no line-in on this laptop which is a little inconvenient since I wanted to make the bass real time video coding pity really the RealTek does some funky features with its sound chips.

    As a solution to my lack of line-In I was thinking of buying a USB SoundBox something like a creative labs. Anyone here tried a USB SoundBox are fast reliable low latency etc.?
    I plan on buying a video encoder ZIO CAMERAMATE VIDEOSAFE USB CM53000. They are all good or could someone recommend another brand best one making double capture of field (> 288 lines).

    See you soon,.

    Richard S.

    [Edited by: admin on 21 March 05 14:17]

    Hello

    I put t know what kind of headphones you use but my is simple and works very well. I use it mainly with Skype and there is no problem. The sound quality is good. One of my friends has a Tecra laptop and it don micro need because there is a built-in screen coverage.

    In my opinion the microphones and video stuff are specific things and each user must search for only the right solution. Last year I tried to connect my VCR VHS to my protégé. I used Pinnacle studio moviebox. It is also connected to the laptop using the USB port. I had no problem and I was able to save all my old videos on the HARD drive. Quality was not brilliant but good enough.

    I'm sure that the USB video encoder will work correctly with your A60. It is just important to read user manuals and see what is the right way to install it correctly.

  • Problem with microphone line

    After the upgrade to Windows 8.1 my microphone online presents as "not connected" when my Touchsmart 300 PC. It worked fine with Windows 8.

    I guess that HP has not yet the right driver. Any ideas on how to solve this problem?

    Thank you

    Hi Stavrosv52,

    Upgrade of Windows 8 speakers aren't working not.
    1. a click right icon "speaker" (right)
    2. Select playback device
    3. click right speakers
    4 activate and as default
    5. click apply/OK

    Please let me know.

    Thank you.

Maybe you are looking for