Dive into the technical aspects of audio on your device, including codecs, format support, and customization options.

Audio Documentation

Posts under Audio subtopic

Post

Replies

Boosts

Views

Activity

Foundation Models for audio recommendation
Is it appropriate to use the Foundation Models framework on-device to power a natural language sound recommendation feature (e.g. user types 'I can't focus' → model returns a frequency/playlist recommendation from a predefined set)? Or is this use case better served by a custom Core ML model? What's the recommended on-device inference approach in iOS 27 for this type of structured recommendation with a small output space?
0
0
36
5d
App Intents for audio playback actions in iOS 27
With SiriKit deprecated in iOS 27, I'm implementing App Intents from scratch for a frequency/ambient sound app. Should I conform to AudioPlaybackIntent from the Media framework or build a custom AppIntent? Specifically, I need intents for: play a named frequency, start sleep timer with duration, stop playback. Is there a recommended Intent entity type for audio content that isn't music (i.e. not MusicKit-backed)?
0
0
32
5d
Does the OS has dedicated volume levels for each AVAudioSessionCategory.
We have an VoiP application, our application can be configured to amplify the PCM samples before feeding it to the Player to achieve volume gain at the receiver. In order to support this, We follow as below. If User has configured this Gain Settings within application, Application applies the amplification for the samples to introduce the gain. Application will also set the AVAudioSessionCategory to AVAudioSessionCategoryPlayback Provided the User has chosen the output to Speaker. This settings was working for us but we see there is a difference in behaviour w.r.t Volume Level System Settings between OS 26.3.1 and OS 26.4 When user has chosen earpiece as Output, then we will set the AVAudioSessionCategory to AVAudioSessionCategoryPlayAndRecord. User would have set the volume level to minimum. When user will change the output to Speaker, then we will set the AVAudioSessionCategory to AVAudioSessionCategoryPlayback. The expectation is, the volume level should be of AVAudioSessionCategoryPlayback what was set earlier instead we are seeing the volume level stays as minimum which was set to AVAudioSessionCategoryPlayAndRecord Could you please explain about this inconsistency w.r.t Volume level.
7
0
1.1k
5d
Visualization of Apple Music audio
Certain apps (eg. DJay) at least seem to have access to audio data from Apple Music streams, either directly or via an indirect dataset for visualization purposes either generated from audio data on the device or delivered from a remote service. Is there any framework provided by Apple or special agreement with Apple that gives access to Apple Music audio data, or sets of visualization meta data, or the ability to run processing of audio data on device or remotely (either on-demand or via preprocessing)?
0
0
26
5d
AUv3 "Failed to find component with type..." frequent issues
When the host app of a host/AUv3 extension pair tries to find the audio extension it fails. The system should have scanned the bundle for the extension, but this appears to fail. This basically happens in SimplePlayEngine.initComponent. I've seen this intermittent problem for years. There are many sometimes-effective workarounds that I've gathered and used, but the problem still exists. It is not a problem of validation -- the same AU can validate in some run cycles and then not be found via the host app in others. I've got a Feedback Assistant ticket for the latest iteration of the problem (FB22860885), which has affected beta testers. Usually I only see this when developing with Xcode myself. So even though the testers' app lives in ~/Applications it is still failing for some of them.
3
0
91
5d
WKWebView / MusicKit.js: Can buffered seeks void audio interruption during playback?
This question overlaps with a newer post that contains additional implementation details To avoid splitting discussion, please see: “MusicKit.js / WKWebView: Are audible hitches during seek a known WebKit or Apple Media Stack limitation?” We are building a music practice application that uses MusicKit.js inside a WKWebView on iOS and macOS. Our application requires tight musical looping, where playback repeatedly seeks back to a loop start position while a song is playing. We have observed that: • Seeking to a nearby position within already-buffered audio using HTMLAudioElement.currentTime causes an audible interruption or hitch. • Changing HTMLAudioElement.playbackRate during playback also appears to interrupt playback briefly. • These interruptions make seamless looping difficult to achieve. For comparison, a very similar JavaScript architecture running in a Chromium-based WebView on Android exhibits significantly smoother seek behavior and supports near-seamless looping. Our questions are: Is it expected that changing currentTime or playbackRate on the underlying audio element causes the playback pipeline to be interrupted or rebuilt on Apple platforms? Are there any recommended WebKit, WKWebView, or MusicKit.js techniques that can reduce or eliminate these interruptions when seeking within already-buffered media? Would native MusicKit playback provide lower-latency or more seamless seeking than MusicKit.js, or do both approaches ultimately rely on the same playback pipeline? Our use case is musical practice, where even interruptions of a few tens of milliseconds are noticeable. Any guidance on achieving the smoothest possible loop-seeking behavior on Apple platforms would be greatly appreciated.
0
0
37
5d
MusicUnderstanding and Apple Music / MusicKit
Certain apps (eg. DJay) seem to have direct or indirect access to the audio data from Apple Music, either on the device or remotely preprocessed. Is that feature available for other third party apps? Am I correct in my understanding that the new framework MusicUnderstanding (which looks quite interesting, judging from the docs so far) is not in any way usable for streams or local files from Apple Music / MusicKit since it relies entirely on AVReadOnlyAudioPCMBuffer? Is there eg. a way to get the same kind of music understanding data (or some other meta data suitable for real time visualization) provided directly form Apple Music without going via a readable audio buffer?
0
2
104
5d
Presentation mode
What's the best way of dealing with presentation mode (when the phone screen is captured by Google Meet or any other presenter software) when AudioSession is activated with .playAndRecord mode? The goal is to share the audio output between the phone and Google Meet so participants can hear it as well, while also enabling a microphone for future interactions within the app, for, let's say, voice chat.
0
0
11
5d
AVSpeechSynthesis voices
Up to iOS 18 there were many voices available on device by default including "Nicky" that I use in my app. Somewhere around iOS 18.6 or 26.0 these voices were removed and no longer included in the OS by default. This broke my app that counted on the Nicky voice being available. My only workaround is to direct my users to download the voice again by going to Accessibility > VoiceOver > Speech > Voices and downloading "Nicky". I cannot simply switch to using Samantha (the only voice that is still available by default) because I have heavily customized how IPA pronunciations are tweaked to make Nicky speak Old English correctly. I tried briefly with Samantha but the results were not as good. I have 2 questions: Is there any way for me to include the "Nicky" voice in my app or for me to trigger the download from the app so I don't have to show an error and direct users through the settings app to get the voice? Are there any new features with AI voices in iOS 27 that I can use with IPA pronunciations to get them to speak possibly better than the Nicky voice?
0
0
23
5d
🎧Define if headphones is only playing device for current session
I need to apply headphone-specific scenario only when headphones are the sole active playback device in my iOS audio app. Problem that there is no absolute way to definitively understand that headphones are the sole active playback device AVAudioSession.currentRoute.outputs portTypes don't guarantee headphones: let session = AVAudioSession.sharedInstance() let outputs = session.currentRoute.outputs let headphonesOnly = outputs.count == 1 && (outputs.first?.portType == .headphones || outputs.first?.portType == .bluetoothA2DP || outputs.first?.portType == .bluetoothHFP || outputs.first?.portType == .bluetoothLE) The issue in code above that listed bluetooth profiles (A2DP, HFP, LE) can be used by any audio device, not only headphones Is there any public API on iOS that can: Distinguish Bluetooth headphones vs Bluetooth speakers when both use A2DP/LE? Expose the user’s “Device Type” classification (headphones / speaker / car stereo, etc.) that is shown in Settings → Bluetooth → Device Type? Provide a more reliable way to know “this route is definitely headphones” for A2DP devices, beyond portType and portName string heuristics?
1
0
247
5d
Audio DSP Processing Issue / Metallic Ringing Artifacts when recording acoustic instruments on iPhone 17 Pro Max
Description: I have identified a specific issue when recording acoustic guitar and other instruments on the iPhone 17 Pro Max using native applications (Voice Memos, Camera). The recordings contain an unnatural metallic resonance (ringing artifacts) that should not be present. Testing and Methodology: Hardware Verification: Initially, I suspected a hardware defect in the audio chip or microphone. However, extensive testing with third-party software suggests this is likely a software-level issue. AudioShare Test: I conducted a test using the AudioShare app in "Measurement Mode" (which bypasses standard iOS system-wide audio processing). In this mode, the audio remains perfectly clean, and the metallic ringing disappears entirely. Conclusion: The issue is rooted in the DSP (Digital Signal Processing) algorithms that iOS applies for noise suppression or voice enhancement. These algorithms appear to misinterpret the high-frequency overtones of acoustic instruments as background noise and attempt to "filter" them, resulting in audible digital artifacts. Comparison Results: This issue has not been observed on devices from other brands or on older iPhone models (preliminary tests suggest older versions handle this better). Notably, the problem persists even in GarageBand, as the app still utilizes certain system-level processing layers. Proposed Solution: I suggest adding a "Raw Audio" or "Instrument Mode" toggle within the Microphone/Audio settings for native apps. This mode should disable aggressive DSP processing, similar to how the AVAudioSession.Mode.measurement works in specialized apps. Attachments: I am attaching 4 archives, including a final "Measurement Mode" folder with comparative samples (Measurement Mode vs. Standard Mode). The artifacts are most prominent when monitored through headphones.
2
1
276
5d
Logic Pro is not displaying AUv3 currentPreset
I have an AUv3 plug-in that works on both iOS and macOS. Some users have complained that after they create a track in Logic Pro (on either iPad or Mac version) and insert my plug-in as an instrument, the track always shows "Untitled" instead of the name of the active preset. Even if the user changes the factory preset, it still says "Untitled". I started debugging my AUv3 API usage for presets, specifically currentPreset and factoryPresets and tried pretty much everything with no success. For example, I tried overriding and not overriding currentPreset, and I tried issuing KVO for currentPreset. But Logic Pro still shows "Untitled" in all cases. In the following screenshot, I'm selecting a factory preset using Logic's interface. Here we see the factory preset is selected and diplayed using the UI of my plug-in, but Logic's interface is still showing Untitled. I noticed AUv2 plug-ins don't seem to suffer from this issue. For example, FabFilter Pro-Q 3 doesn't expose its factory parameters, but I can create a custom preset inside it or load a factory preset and Logic's interface will display the name of the plug-in. I'm assuming the v2 API kAudioUnitProperty_PresentPreset doesn't suffer fron this issue? Here's Logic Pro showing Pro-Q 3's custom preset name I created using the plug-in interface. Is there a solution to this? Or is this a bug? And then whose bug is it Logic's or Core Audio?
1
0
429
5d
AUv3 UI issues on Desktop / Logic Pro for Mac
With the release of liquid glass last year, I was trying to migrate my AUv3 to use native toolbars, and I noticed on macOS, AUv3's toolbar wouldn't display in Logic Pro (pretty sure it was the same with Ableton Live). But on iOS, it was fine. In the end, I decided to continue to use my custom toolbar because I had more control, but I thought I'd mention it here in case it can be fixed and warn the other users hitting the same issue. Another thing I noticed on the desktop is that presentation animations were removed. For example, AUv3 trying to show a popover on macOS inside, say Logic Pro, would make the popover appear instantly, with no animation. But animations worked great on iPadOS, however.
1
0
71
5d
AVAudioInputNode setup
What's the best way of dealing with AVAudioInputNode from resources perspective? Ideally, to install it as soon as it is necessary for microphone access and use it as long as it is necessary (for example, when you have a long voice chat where users exchange voice messages intermittently AVAudioInputNode should be installed at the beginning and kept until the chat ends) Or is it better to setup it inputNode.installTap( onBus: bus, bufferSize: bufferSize, format: format, block: { buffer, _ in } ) everytime user accessing microphone with push to talk The question is what's better from a performance perspective
1
0
61
5d
Real-time audio monitoring
My app provides real-time microphone monitoring and level metering on iPhone, iPad, and Mac using AVAudioEngine. When users switch between built-in microphones, USB microphones, Bluetooth microphones, and Continuity Camera audio, the audio route often changes before audio buffers begin flowing. This can result in a brief period where the app sees a valid route but receives no audio data. What is Apple's recommended approach in iOS 26 and macOS 26 for determining when an input route is truly ready for real-time monitoring after a route change?
1
0
61
5d
AirPods Custom EQ in iOS 27 beta: is AirPods Max supported?
Hi Apple team, I’m testing iOS 27 Developer Beta 1 and I’m trying to understand the new AirPods Custom EQ feature announced for iOS 27. I’m using AirPods Max, but I can’t find the Custom EQ setting in the AirPods settings page. I have a few questions: Where exactly should the AirPods Custom EQ setting appear in iOS 27? Does this feature require a specific AirPods firmware version? Is AirPods Custom EQ supported on AirPods Max, including the USB-C model? If the EQ option does not appear on AirPods Max while running iOS 27 Developer Beta 1, is this expected behavior or should I file feedback? Thanks.
1
1
105
6d
Error -50 writing to AVAudioFile
I'm trying to write 16-bit interleaved 2-channel data captured from a LiveSwitch audio source to a AVAudioFile. The buffer and file formats match but I get a bad parameter error from the API. Does this API not support the specified format or is there some other issue? Here is the debugger output. (lldb) po audioFile.url ▿ file:///private/var/mobile/Containers/Data/Application/1EB14379-0CF2-41B6-B742-4C9A80728DB3/tmp/Heart%20Sounds%201 - _url : file:///private/var/mobile/Containers/Data/Application/1EB14379-0CF2-41B6-B742-4C9A80728DB3/tmp/Heart%20Sounds%201 - _parseInfo : nil - _baseParseInfo : nil (lldb) po error Error Domain=com.apple.coreaudio.avfaudio Code=-50 "(null)" UserInfo={failed call=ExtAudioFileWrite(_impl->_extAudioFile, buffer.frameLength, buffer.audioBufferList)} (lldb) po buffer.format <AVAudioFormat 0x302a12b20: 2 ch, 44100 Hz, Int16, interleaved> (lldb) po audioFile.fileFormat <AVAudioFormat 0x302a515e0: 2 ch, 44100 Hz, Int16, interleaved> (lldb) po buffer.frameLength 882 (lldb) po buffer.audioBufferList ▿ 0x0000000300941e60 - pointerValue : 12894608992 This code handles the details of converting the Live Switch frame into an AVAudioPCMBuffer. extension FMLiveSwitchAudioFrame { func convertedToPCMBuffer() -> AVAudioPCMBuffer { Self.convertToAVAudioPCMBuffer(from: self)! } static func convertToAVAudioPCMBuffer(from frame: FMLiveSwitchAudioFrame) -> AVAudioPCMBuffer? { // Retrieve the audio buffer and format details from the FMLiveSwitchAudioFrame guard let buffer = frame.buffer(), let format = buffer.format() as? FMLiveSwitchAudioFormat else { return nil } // Extract PCM format details from FMLiveSwitchAudioFormat let sampleRate = Double(format.clockRate()) let channelCount = AVAudioChannelCount(format.channelCount()) // Determine bytes per sample based on bit depth let bitsPerSample = 16 let bytesPerSample = bitsPerSample / 8 let bytesPerFrame = bytesPerSample * Int(channelCount) let frameLength = AVAudioFrameCount(Int(buffer.dataBuffer().length()) / bytesPerFrame) // Create an AVAudioFormat from the FMLiveSwitchAudioFormat guard let avAudioFormat = AVAudioFormat(commonFormat: .pcmFormatInt16, sampleRate: sampleRate, channels: channelCount, interleaved: true) else { return nil } // Create an AudioBufferList to wrap the existing buffer let audioBufferList = UnsafeMutablePointer<AudioBufferList>.allocate(capacity: 1) audioBufferList.pointee.mNumberBuffers = 1 audioBufferList.pointee.mBuffers.mNumberChannels = channelCount audioBufferList.pointee.mBuffers.mDataByteSize = UInt32(buffer.dataBuffer().length()) audioBufferList.pointee.mBuffers.mData = buffer.dataBuffer().data().mutableBytes // Directly use LiveSwitch buffer // Transfer ownership of the buffer to AVAudioPCMBuffer let pcmBuffer = AVAudioPCMBuffer(pcmFormat: avAudioFormat, bufferListNoCopy: audioBufferList) /* { buffer in // Ensure the buffer is freed when AVAudioPCMBuffer is deallocated buffer.deallocate() // Only call this if LiveSwitch allows manual deallocation } */ pcmBuffer?.frameLength = frameLength return pcmBuffer } } This is the handler that is invoked with every frame in order to convert it for use with AVAudioFile and optionally update a scrolling signal display on the screen. private func onRaisedFrame(obj: Any!) -> Void { // Bail out early if no one is interested in the data. guard isMonitoring else { return } // Convert LS frame to AVAudioPCMBuffer (no-copy) let frame = obj as! FMLiveSwitchAudioFrame let buffer = frame.convertedToPCMBuffer() // Hand subscribers a reference to the buffer for rendering to display. bufferPublisher?.send(buffer) // If we have and output file, store the data there, as well. guard let audioFile = self.audioFile else { return } do { try audioFile.write(from: buffer) // FIXME: This call is throwing error -50 } catch { FMLiveSwitchLog.error(withMessage: "Failed to write buffer to audio file at \(audioFile.url): \(error)") self.audioFile = nil } } This is how the audio file is being setup. static var recordingFormat: AVAudioFormat = { AVAudioFormat(commonFormat: .pcmFormatInt16, sampleRate: 44_100, channels: 2, interleaved: true)! }() let audioFile = try AVAudioFile(forWriting: outputURL, settings: Self.recordingFormat.settings)
1
0
535
6d
Learning and practice resources
Hello team! Wanted to ask you if there is any resource to learn and practice PHASE, the theory in the official site is great but not much is out there to put it into practice with a real project, for instance. Thank you!
1
0
77
6d
Foundation Models for audio recommendation
Is it appropriate to use the Foundation Models framework on-device to power a natural language sound recommendation feature (e.g. user types 'I can't focus' → model returns a frequency/playlist recommendation from a predefined set)? Or is this use case better served by a custom Core ML model? What's the recommended on-device inference approach in iOS 27 for this type of structured recommendation with a small output space?
Replies
0
Boosts
0
Views
36
Activity
5d
App Intents for audio playback actions in iOS 27
With SiriKit deprecated in iOS 27, I'm implementing App Intents from scratch for a frequency/ambient sound app. Should I conform to AudioPlaybackIntent from the Media framework or build a custom AppIntent? Specifically, I need intents for: play a named frequency, start sleep timer with duration, stop playback. Is there a recommended Intent entity type for audio content that isn't music (i.e. not MusicKit-backed)?
Replies
0
Boosts
0
Views
32
Activity
5d
Does the OS has dedicated volume levels for each AVAudioSessionCategory.
We have an VoiP application, our application can be configured to amplify the PCM samples before feeding it to the Player to achieve volume gain at the receiver. In order to support this, We follow as below. If User has configured this Gain Settings within application, Application applies the amplification for the samples to introduce the gain. Application will also set the AVAudioSessionCategory to AVAudioSessionCategoryPlayback Provided the User has chosen the output to Speaker. This settings was working for us but we see there is a difference in behaviour w.r.t Volume Level System Settings between OS 26.3.1 and OS 26.4 When user has chosen earpiece as Output, then we will set the AVAudioSessionCategory to AVAudioSessionCategoryPlayAndRecord. User would have set the volume level to minimum. When user will change the output to Speaker, then we will set the AVAudioSessionCategory to AVAudioSessionCategoryPlayback. The expectation is, the volume level should be of AVAudioSessionCategoryPlayback what was set earlier instead we are seeing the volume level stays as minimum which was set to AVAudioSessionCategoryPlayAndRecord Could you please explain about this inconsistency w.r.t Volume level.
Replies
7
Boosts
0
Views
1.1k
Activity
5d
Visualization of Apple Music audio
Certain apps (eg. DJay) at least seem to have access to audio data from Apple Music streams, either directly or via an indirect dataset for visualization purposes either generated from audio data on the device or delivered from a remote service. Is there any framework provided by Apple or special agreement with Apple that gives access to Apple Music audio data, or sets of visualization meta data, or the ability to run processing of audio data on device or remotely (either on-demand or via preprocessing)?
Replies
0
Boosts
0
Views
26
Activity
5d
Building AUv3's?
Any chance of more modern framework for building AUv3's coming anytime soon?
Replies
4
Boosts
0
Views
80
Activity
5d
AUv3 "Failed to find component with type..." frequent issues
When the host app of a host/AUv3 extension pair tries to find the audio extension it fails. The system should have scanned the bundle for the extension, but this appears to fail. This basically happens in SimplePlayEngine.initComponent. I've seen this intermittent problem for years. There are many sometimes-effective workarounds that I've gathered and used, but the problem still exists. It is not a problem of validation -- the same AU can validate in some run cycles and then not be found via the host app in others. I've got a Feedback Assistant ticket for the latest iteration of the problem (FB22860885), which has affected beta testers. Usually I only see this when developing with Xcode myself. So even though the testers' app lives in ~/Applications it is still failing for some of them.
Replies
3
Boosts
0
Views
91
Activity
5d
WKWebView / MusicKit.js: Can buffered seeks void audio interruption during playback?
This question overlaps with a newer post that contains additional implementation details To avoid splitting discussion, please see: “MusicKit.js / WKWebView: Are audible hitches during seek a known WebKit or Apple Media Stack limitation?” We are building a music practice application that uses MusicKit.js inside a WKWebView on iOS and macOS. Our application requires tight musical looping, where playback repeatedly seeks back to a loop start position while a song is playing. We have observed that: • Seeking to a nearby position within already-buffered audio using HTMLAudioElement.currentTime causes an audible interruption or hitch. • Changing HTMLAudioElement.playbackRate during playback also appears to interrupt playback briefly. • These interruptions make seamless looping difficult to achieve. For comparison, a very similar JavaScript architecture running in a Chromium-based WebView on Android exhibits significantly smoother seek behavior and supports near-seamless looping. Our questions are: Is it expected that changing currentTime or playbackRate on the underlying audio element causes the playback pipeline to be interrupted or rebuilt on Apple platforms? Are there any recommended WebKit, WKWebView, or MusicKit.js techniques that can reduce or eliminate these interruptions when seeking within already-buffered media? Would native MusicKit playback provide lower-latency or more seamless seeking than MusicKit.js, or do both approaches ultimately rely on the same playback pipeline? Our use case is musical practice, where even interruptions of a few tens of milliseconds are noticeable. Any guidance on achieving the smoothest possible loop-seeking behavior on Apple platforms would be greatly appreciated.
Replies
0
Boosts
0
Views
37
Activity
5d
MusicUnderstanding and Apple Music / MusicKit
Certain apps (eg. DJay) seem to have direct or indirect access to the audio data from Apple Music, either on the device or remotely preprocessed. Is that feature available for other third party apps? Am I correct in my understanding that the new framework MusicUnderstanding (which looks quite interesting, judging from the docs so far) is not in any way usable for streams or local files from Apple Music / MusicKit since it relies entirely on AVReadOnlyAudioPCMBuffer? Is there eg. a way to get the same kind of music understanding data (or some other meta data suitable for real time visualization) provided directly form Apple Music without going via a readable audio buffer?
Replies
0
Boosts
2
Views
104
Activity
5d
Presentation mode
What's the best way of dealing with presentation mode (when the phone screen is captured by Google Meet or any other presenter software) when AudioSession is activated with .playAndRecord mode? The goal is to share the audio output between the phone and Google Meet so participants can hear it as well, while also enabling a microphone for future interactions within the app, for, let's say, voice chat.
Replies
0
Boosts
0
Views
11
Activity
5d
AVSpeechSynthesis voices
Up to iOS 18 there were many voices available on device by default including "Nicky" that I use in my app. Somewhere around iOS 18.6 or 26.0 these voices were removed and no longer included in the OS by default. This broke my app that counted on the Nicky voice being available. My only workaround is to direct my users to download the voice again by going to Accessibility > VoiceOver > Speech > Voices and downloading "Nicky". I cannot simply switch to using Samantha (the only voice that is still available by default) because I have heavily customized how IPA pronunciations are tweaked to make Nicky speak Old English correctly. I tried briefly with Samantha but the results were not as good. I have 2 questions: Is there any way for me to include the "Nicky" voice in my app or for me to trigger the download from the app so I don't have to show an error and direct users through the settings app to get the voice? Are there any new features with AI voices in iOS 27 that I can use with IPA pronunciations to get them to speak possibly better than the Nicky voice?
Replies
0
Boosts
0
Views
23
Activity
5d
🎧Define if headphones is only playing device for current session
I need to apply headphone-specific scenario only when headphones are the sole active playback device in my iOS audio app. Problem that there is no absolute way to definitively understand that headphones are the sole active playback device AVAudioSession.currentRoute.outputs portTypes don't guarantee headphones: let session = AVAudioSession.sharedInstance() let outputs = session.currentRoute.outputs let headphonesOnly = outputs.count == 1 && (outputs.first?.portType == .headphones || outputs.first?.portType == .bluetoothA2DP || outputs.first?.portType == .bluetoothHFP || outputs.first?.portType == .bluetoothLE) The issue in code above that listed bluetooth profiles (A2DP, HFP, LE) can be used by any audio device, not only headphones Is there any public API on iOS that can: Distinguish Bluetooth headphones vs Bluetooth speakers when both use A2DP/LE? Expose the user’s “Device Type” classification (headphones / speaker / car stereo, etc.) that is shown in Settings → Bluetooth → Device Type? Provide a more reliable way to know “this route is definitely headphones” for A2DP devices, beyond portType and portName string heuristics?
Replies
1
Boosts
0
Views
247
Activity
5d
Audio DSP Processing Issue / Metallic Ringing Artifacts when recording acoustic instruments on iPhone 17 Pro Max
Description: I have identified a specific issue when recording acoustic guitar and other instruments on the iPhone 17 Pro Max using native applications (Voice Memos, Camera). The recordings contain an unnatural metallic resonance (ringing artifacts) that should not be present. Testing and Methodology: Hardware Verification: Initially, I suspected a hardware defect in the audio chip or microphone. However, extensive testing with third-party software suggests this is likely a software-level issue. AudioShare Test: I conducted a test using the AudioShare app in "Measurement Mode" (which bypasses standard iOS system-wide audio processing). In this mode, the audio remains perfectly clean, and the metallic ringing disappears entirely. Conclusion: The issue is rooted in the DSP (Digital Signal Processing) algorithms that iOS applies for noise suppression or voice enhancement. These algorithms appear to misinterpret the high-frequency overtones of acoustic instruments as background noise and attempt to "filter" them, resulting in audible digital artifacts. Comparison Results: This issue has not been observed on devices from other brands or on older iPhone models (preliminary tests suggest older versions handle this better). Notably, the problem persists even in GarageBand, as the app still utilizes certain system-level processing layers. Proposed Solution: I suggest adding a "Raw Audio" or "Instrument Mode" toggle within the Microphone/Audio settings for native apps. This mode should disable aggressive DSP processing, similar to how the AVAudioSession.Mode.measurement works in specialized apps. Attachments: I am attaching 4 archives, including a final "Measurement Mode" folder with comparative samples (Measurement Mode vs. Standard Mode). The artifacts are most prominent when monitored through headphones.
Replies
2
Boosts
1
Views
276
Activity
5d
Logic Pro is not displaying AUv3 currentPreset
I have an AUv3 plug-in that works on both iOS and macOS. Some users have complained that after they create a track in Logic Pro (on either iPad or Mac version) and insert my plug-in as an instrument, the track always shows "Untitled" instead of the name of the active preset. Even if the user changes the factory preset, it still says "Untitled". I started debugging my AUv3 API usage for presets, specifically currentPreset and factoryPresets and tried pretty much everything with no success. For example, I tried overriding and not overriding currentPreset, and I tried issuing KVO for currentPreset. But Logic Pro still shows "Untitled" in all cases. In the following screenshot, I'm selecting a factory preset using Logic's interface. Here we see the factory preset is selected and diplayed using the UI of my plug-in, but Logic's interface is still showing Untitled. I noticed AUv2 plug-ins don't seem to suffer from this issue. For example, FabFilter Pro-Q 3 doesn't expose its factory parameters, but I can create a custom preset inside it or load a factory preset and Logic's interface will display the name of the plug-in. I'm assuming the v2 API kAudioUnitProperty_PresentPreset doesn't suffer fron this issue? Here's Logic Pro showing Pro-Q 3's custom preset name I created using the plug-in interface. Is there a solution to this? Or is this a bug? And then whose bug is it Logic's or Core Audio?
Replies
1
Boosts
0
Views
429
Activity
5d
ASAF Panner Pro Tools Plug In
A recent WWDC session "Learn about Apple Immersive Video technologies" showed a Apple Spatial Audio Format Panner plugin for Pro Tools. The presenter stated that it's available on a per-user license. Where can users access this?
Replies
3
Boosts
3
Views
491
Activity
5d
AUv3 UI issues on Desktop / Logic Pro for Mac
With the release of liquid glass last year, I was trying to migrate my AUv3 to use native toolbars, and I noticed on macOS, AUv3's toolbar wouldn't display in Logic Pro (pretty sure it was the same with Ableton Live). But on iOS, it was fine. In the end, I decided to continue to use my custom toolbar because I had more control, but I thought I'd mention it here in case it can be fixed and warn the other users hitting the same issue. Another thing I noticed on the desktop is that presentation animations were removed. For example, AUv3 trying to show a popover on macOS inside, say Logic Pro, would make the popover appear instantly, with no animation. But animations worked great on iPadOS, however.
Replies
1
Boosts
0
Views
71
Activity
5d
AVAudioInputNode setup
What's the best way of dealing with AVAudioInputNode from resources perspective? Ideally, to install it as soon as it is necessary for microphone access and use it as long as it is necessary (for example, when you have a long voice chat where users exchange voice messages intermittently AVAudioInputNode should be installed at the beginning and kept until the chat ends) Or is it better to setup it inputNode.installTap( onBus: bus, bufferSize: bufferSize, format: format, block: { buffer, _ in } ) everytime user accessing microphone with push to talk The question is what's better from a performance perspective
Replies
1
Boosts
0
Views
61
Activity
5d
Real-time audio monitoring
My app provides real-time microphone monitoring and level metering on iPhone, iPad, and Mac using AVAudioEngine. When users switch between built-in microphones, USB microphones, Bluetooth microphones, and Continuity Camera audio, the audio route often changes before audio buffers begin flowing. This can result in a brief period where the app sees a valid route but receives no audio data. What is Apple's recommended approach in iOS 26 and macOS 26 for determining when an input route is truly ready for real-time monitoring after a route change?
Replies
1
Boosts
0
Views
61
Activity
5d
AirPods Custom EQ in iOS 27 beta: is AirPods Max supported?
Hi Apple team, I’m testing iOS 27 Developer Beta 1 and I’m trying to understand the new AirPods Custom EQ feature announced for iOS 27. I’m using AirPods Max, but I can’t find the Custom EQ setting in the AirPods settings page. I have a few questions: Where exactly should the AirPods Custom EQ setting appear in iOS 27? Does this feature require a specific AirPods firmware version? Is AirPods Custom EQ supported on AirPods Max, including the USB-C model? If the EQ option does not appear on AirPods Max while running iOS 27 Developer Beta 1, is this expected behavior or should I file feedback? Thanks.
Replies
1
Boosts
1
Views
105
Activity
6d
Error -50 writing to AVAudioFile
I'm trying to write 16-bit interleaved 2-channel data captured from a LiveSwitch audio source to a AVAudioFile. The buffer and file formats match but I get a bad parameter error from the API. Does this API not support the specified format or is there some other issue? Here is the debugger output. (lldb) po audioFile.url ▿ file:///private/var/mobile/Containers/Data/Application/1EB14379-0CF2-41B6-B742-4C9A80728DB3/tmp/Heart%20Sounds%201 - _url : file:///private/var/mobile/Containers/Data/Application/1EB14379-0CF2-41B6-B742-4C9A80728DB3/tmp/Heart%20Sounds%201 - _parseInfo : nil - _baseParseInfo : nil (lldb) po error Error Domain=com.apple.coreaudio.avfaudio Code=-50 "(null)" UserInfo={failed call=ExtAudioFileWrite(_impl->_extAudioFile, buffer.frameLength, buffer.audioBufferList)} (lldb) po buffer.format <AVAudioFormat 0x302a12b20: 2 ch, 44100 Hz, Int16, interleaved> (lldb) po audioFile.fileFormat <AVAudioFormat 0x302a515e0: 2 ch, 44100 Hz, Int16, interleaved> (lldb) po buffer.frameLength 882 (lldb) po buffer.audioBufferList ▿ 0x0000000300941e60 - pointerValue : 12894608992 This code handles the details of converting the Live Switch frame into an AVAudioPCMBuffer. extension FMLiveSwitchAudioFrame { func convertedToPCMBuffer() -> AVAudioPCMBuffer { Self.convertToAVAudioPCMBuffer(from: self)! } static func convertToAVAudioPCMBuffer(from frame: FMLiveSwitchAudioFrame) -> AVAudioPCMBuffer? { // Retrieve the audio buffer and format details from the FMLiveSwitchAudioFrame guard let buffer = frame.buffer(), let format = buffer.format() as? FMLiveSwitchAudioFormat else { return nil } // Extract PCM format details from FMLiveSwitchAudioFormat let sampleRate = Double(format.clockRate()) let channelCount = AVAudioChannelCount(format.channelCount()) // Determine bytes per sample based on bit depth let bitsPerSample = 16 let bytesPerSample = bitsPerSample / 8 let bytesPerFrame = bytesPerSample * Int(channelCount) let frameLength = AVAudioFrameCount(Int(buffer.dataBuffer().length()) / bytesPerFrame) // Create an AVAudioFormat from the FMLiveSwitchAudioFormat guard let avAudioFormat = AVAudioFormat(commonFormat: .pcmFormatInt16, sampleRate: sampleRate, channels: channelCount, interleaved: true) else { return nil } // Create an AudioBufferList to wrap the existing buffer let audioBufferList = UnsafeMutablePointer<AudioBufferList>.allocate(capacity: 1) audioBufferList.pointee.mNumberBuffers = 1 audioBufferList.pointee.mBuffers.mNumberChannels = channelCount audioBufferList.pointee.mBuffers.mDataByteSize = UInt32(buffer.dataBuffer().length()) audioBufferList.pointee.mBuffers.mData = buffer.dataBuffer().data().mutableBytes // Directly use LiveSwitch buffer // Transfer ownership of the buffer to AVAudioPCMBuffer let pcmBuffer = AVAudioPCMBuffer(pcmFormat: avAudioFormat, bufferListNoCopy: audioBufferList) /* { buffer in // Ensure the buffer is freed when AVAudioPCMBuffer is deallocated buffer.deallocate() // Only call this if LiveSwitch allows manual deallocation } */ pcmBuffer?.frameLength = frameLength return pcmBuffer } } This is the handler that is invoked with every frame in order to convert it for use with AVAudioFile and optionally update a scrolling signal display on the screen. private func onRaisedFrame(obj: Any!) -> Void { // Bail out early if no one is interested in the data. guard isMonitoring else { return } // Convert LS frame to AVAudioPCMBuffer (no-copy) let frame = obj as! FMLiveSwitchAudioFrame let buffer = frame.convertedToPCMBuffer() // Hand subscribers a reference to the buffer for rendering to display. bufferPublisher?.send(buffer) // If we have and output file, store the data there, as well. guard let audioFile = self.audioFile else { return } do { try audioFile.write(from: buffer) // FIXME: This call is throwing error -50 } catch { FMLiveSwitchLog.error(withMessage: "Failed to write buffer to audio file at \(audioFile.url): \(error)") self.audioFile = nil } } This is how the audio file is being setup. static var recordingFormat: AVAudioFormat = { AVAudioFormat(commonFormat: .pcmFormatInt16, sampleRate: 44_100, channels: 2, interleaved: true)! }() let audioFile = try AVAudioFile(forWriting: outputURL, settings: Self.recordingFormat.settings)
Replies
1
Boosts
0
Views
535
Activity
6d
Learning and practice resources
Hello team! Wanted to ask you if there is any resource to learn and practice PHASE, the theory in the official site is great but not much is out there to put it into practice with a real project, for instance. Thank you!
Replies
1
Boosts
0
Views
77
Activity
6d