From: Paul Brossier Date: Wed, 19 Dec 2018 14:25:04 +0000 (+0100) Subject: [io] sink_apple_audio uses software-based encoding on ios X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=99365e9922e6516dbd63b084de996573c5f5a767;p=aubio.git [io] sink_apple_audio uses software-based encoding on ios --- diff --git a/src/io/sink_apple_audio.c b/src/io/sink_apple_audio.c index f93691f5..e0079008 100644 --- a/src/io/sink_apple_audio.c +++ b/src/io/sink_apple_audio.c @@ -238,6 +238,20 @@ uint_t aubio_sink_apple_audio_open(aubio_sink_apple_audio_t *s) { 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);