shithub: aubio

Download patch

ref: 99365e9922e6516dbd63b084de996573c5f5a767
parent: 2b208a897175d73958ceb929e97438bf282f627e
author: Paul Brossier <piem@piem.org>
date: Wed Dec 19 10:25:04 EST 2018

[io] sink_apple_audio uses software-based encoding on ios

--- a/src/io/sink_apple_audio.c
+++ b/src/io/sink_apple_audio.c
@@ -238,6 +238,20 @@
     goto beach;
   }
 
+#if defined(kAppleSoftwareAudioCodecManufacturer)
+  // on iOS, set software based encoding before setting clientDataFormat
+  UInt32 codecManf = kAppleSoftwareAudioCodecManufacturer;
+  err = ExtAudioFileSetProperty(s->audioFile,
+      kExtAudioFileProperty_CodecManufacturer,
+      sizeof(UInt32), &codecManf);
+  if (err) {
+    char_t errorstr[20];
+    AUBIO_ERR("sink_apple_audio: error when trying to set sofware codec on %s "
+        "(%s)\n", s->path, getPrintableOSStatusError(errorstr, err));
+    goto beach;
+  }
+#endif
+
   err = ExtAudioFileSetProperty(s->audioFile,
       kExtAudioFileProperty_ClientDataFormat,
       sizeof(AudioStreamBasicDescription), &inputFormat);