3 Replies
      Latest reply: Oct 14, 2016 12:58 AM by eskimo RSS
      balatom79 Level 1 Level 1 (0 points)

        Hello,

         

        What is the right way to implement an application that records audio chunks from microphone, but not continuously ? (for example : record 10s once every 5 minutes).

        If we use the audio background mode, the app might get suspended at any time as soon as the microphone recording stops...

         

        Thank you in advance for your suggestions.

        regards

         

        (message reduced to the very minimum to avoid the "message contains invalid characters" error ...)

        • Re: microphone recording in background
          Beast Level 3 Level 3 (125 points)

          You would need to keep listening and then save off the 10s chunks of audio as needed.

            • Re: microphone recording in background
              balatom79 Level 1 Level 1 (0 points)

              We would like to reduce battery usage. Recording continuously will quickly drain the battery, and we only need a few seconds every few minutes.

              Any way to do that without getting suspended ?

              Or, would it be possible to reactivate the app at regular time intervals ? (we have taken a look at the "fetch" background mode but the time interval is decided by the system)

                • Re: microphone recording in background
                  eskimo Apple Staff Apple Staff (6,975 points)

                  We would like to reduce battery usage. Recording continuously will quickly drain the battery, and we only need a few seconds every few minutes.

                  There is no good way to do this.  The audio background support only allows you to continue using an audio session that you created in the foreground; it does not allow you to start a session from the background.  To reduce battery life you’d have to stop the session so that you can go idle (or, better yet, suspend) but then you can’t start it again.

                  Share and Enjoy

                  Quinn “The Eskimo!”
                  Apple Developer Relations, Developer Technical Support, Core OS/Hardware
                  let myEmail = "eskimo" + "1" + "@apple.com"