3

My iOS app writes a stereo audio stream into a circular buffer at 44.1KHz and outputs successfully to either simulator or iOS device. I want to capture the audio stream while the app is running in Xcode and do it without altering the code or converting the stream to an analogue signal.

Initially I tried using SoundFlower with Audacity and Quicktime. Both work with audio from the internal microphone but unfortunately capture ambient noise and with Soundflower(2ch) input selected no signal activity appears in the monitor on either Audacity or Quicktime.

I am now trying to create an ogg file by capturing a digital audio stream using terminal e.g. copying the stream and piping the copy into a file, a bit like this Linux solution

       arecord -f cd -t raw | oggenc – -r -o out.ogg

The following Unix command line fails to capture audio when it records video according to this Radar community bug report submitted Feb 2018.

       xcrun simctl io booted recordVideo my video.mp4

I have set up command line tools so audio data sent from Xcode to the simulator can be captured. This answer (from 2015) says it is not possible to intercept a background audio stream from another app. But does anyone know a way to pipe an audio stream into a file using xcrun simctl io ?

Greg
  • 1,750
  • 2
  • 29
  • 56

0 Answers0