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

Volumes issue
My volume will randomly go all the way down to mute or all the way up to full blast while I’m listen to music, watching a video, playing a game. I have all the volume safety features turned off. Does anyone else have this issue?
1
0
424
3w
Does the TN3135 audio-session networking exception have a defined lifetime? Seeing a ~38.5 s revoke/re-grant cycle
TN3135 describes the exception that lets a watchOS app use low-level networking while it holds an active audio session. I have that working, and the app functions — but the network path is withdrawn and restored on a strikingly regular cycle, and I would like to know whether that is expected behaviour rather than something I am doing wrong. Setup Apple Watch Series 10 (Watch7,9), watchOS 26.5. Reproduced on a Series 6 (Watch6,2). UIBackgroundModes: [audio]; AVAudioSession category .playAndRecord, mode .spokenAudio; activated with the async activate(options:completionHandler:). NWConnection with NWProtocolWebSocket to a WebSocket relay over TLS. The app streams 16 kHz mono PCM continuously while transmitting and holds the socket open otherwise. Symptom NWPathMonitor reports .unsatisfied, then .satisfied about two seconds later, over and over. Measured with the iPhone powered off, so the watch was on its own Wi-Fi: Uptime between drops Outage 36.4 s 2.1 s 36.7 s 1.9 s 36.9 s 2.1 s The regularity is what prompts the question — uptime varies by ±0.3 s and the outage is consistently 2.0 s. That reads as a timeout expiring rather than radio behaviour. What I have ruled out Not the network or the server. A browser client on the same relay, same TLS, same wire protocol, holds a WebSocket indefinitely. Not the interface. Identical cadence over the companion ipsec1 tunnel with the iPhone present, and over the watch's own en0 with the iPhone powered off. Pinning requiredInterfaceType = .wifi while the iPhone is reachable fails outright — the path offers only ipsec1. Not audio-session interruption. I observe interruptionNotification, routeChangeNotification, mediaServicesWereResetNotification and silenceSecondaryAudioHintNotification. None fire at a drop. At the moment the path goes .unsatisfied, the engine is running and the player node is actively playing. Not session idleness. Playing continuous silence for the whole session, rather than only while reconnecting, made no difference — still 36.4 s. The control that surprised me To test whether this affects any long-lived watch socket or only audio-unlocked ones, I built a second app with no AVAudioSession at all, no audio background mode, holding a URLSessionWebSocketTask and kept alive by a WKExtendedRuntimeSession so screen sleep was not a factor. It never connected. NWPathMonitor reported .unsatisfied once and never changed, across a 30 s run, and every request failed with "The Internet connection appears to be offline." I had expected URLSession to be permitted regardless. Questions Does the audio-session networking exception in TN3135 have a defined lifetime, and is a periodic revoke/re-grant cycle expected? If so, is there a supported way to hold it continuously — or is the correct design simply to expect the interruption and reconnect through it? Is it expected that an app with no audio session gets no network path at all on watchOS, including via URLSession, even in the foreground with an extended runtime session?
16
0
3.6k
3w
AirPods Sleep Detection pauses meditation playback with no API/callback to identify the reason
Good morning! I work on a meditation app, and since Sleep Detection was introduced for AirPods in iOS 26, we've been receiving complaints from users reporting that their meditation sessions unexpectedly stop after approximately 15–20 minutes when Sleep Detection is enabled. This seems to happen particularly during deep meditation sessions, where the user may remain still and exhibit behavior that could potentially be interpreted as falling asleep. I've also tested this on iOS 27 with the latest beta firmware available for AirPods Pro, and the same behavior still occurs. While investigating and debugging the issue, I found that there doesn't appear to be any public API that allows an app to determine that playback was paused specifically because of AirPods Sleep Detection. From the application's perspective, the AirPods appear to simply send a standard pause command to the AVPlayer, without providing any additional context or reason. There also doesn't seem to be an API that allows us to determine whether the user has Sleep Detection enabled. Even having access to that information would allow us to warn users that their meditation session could potentially be interrupted. AVAudioSession.InterruptionReason does not seem to help in this case either: https://developer.apple.com/documentation/avfaudio/avaudiosession/interruptionreason Is there currently any supported way for an app to: Detect that playback was paused specifically because of AirPods Sleep Detection? Determine whether Sleep Detection is enabled for the connected AirPods? Prevent Sleep Detection from pausing playback for specific apps or specific types of audio sessions? If none of these are currently possible, could Apple consider providing either a notification/callback indicating that Sleep Detection triggered the pause, or an option for users to exclude specific apps from Sleep Detection? This behavior is particularly problematic for meditation apps, since a user in a deep meditation session can easily be mistaken for someone who has fallen asleep. Other meditation apps appear to be affected by the same behavior as well. Best regards, Carlos Antunes
1
0
1k
3w
MusicKit on HarmonyOS — playback approach for a platform without an official SDK, licensing question
Hello Apple Developer community, I'm building an Apple Music client for HarmonyOS (Huawei's operating system) and would like to clarify the licensing and technical approach before submitting to a third-party app store (Huawei AppGallery). I've read the Apple Developer Program License Agreement and App Store Review Guideline 4.5.2, but there are platform-specific constraints I'd like to discuss. Background Apple currently does not provide a MusicKit SDK for HarmonyOS. The available options are: MusicKit for iOS/macOS — not applicable (different OS) MusicKit for Android — ships as proprietary .aar binaries that cannot be redistributed and are not compatible with HarmonyOS's runtime MusicKit JS — available, but HarmonyOS WebView does not support FairPlay or Widevine EME, so full-song DRM playback through MusicKit JS does not work on this platform The only Apple Music API access path available to a HarmonyOS app is the REST API (api.music.apple.com) with a Developer Token (JWT, ES256) and a Music User Token obtained through the MusicKit JS authorization flow running inside a WebView. The technical constraint To deliver full-song playback for subscribed Apple Music users on HarmonyOS, our app retrieves the HLS playback URL via the Apple Music API, downloads the encrypted media segments, and decrypts them using HarmonyOS's native DRM system (WisePlay, the only CDM available on the platform). MusicKit JS's FairPlay/Widevine CDM is not compatible with HarmonyOS — WisePlay is the sole DRM implementation the OS exposes. We are aware that Section 4.5.2 states: "You may not, and You may not permit Your end users to, download, upload, or modify any MusicKit Content" and "You may play MusicKit Content only as rendered by the MusicKit APIs or MusicKit JS" What we want to clarify Our playback implementation works as follows, and we want to confirm whether it is acceptable under the license terms: No download service is offered to users. The download is purely an internal playback mechanism — the app fetches encrypted segments, decrypts them in memory / a protected sandbox, and plays them via the system AVPlayer. There is no "download button," no offline library, no user-facing download feature. Decrypted files are ephemeral and protected. Decrypted media is written to the app's private sandbox (not accessible to users or other apps), played immediately, and deleted as soon as playback ends or the song is skipped. The decrypted file never persists beyond the current playback session. No file leakage. The decrypted content is never exposed via any sharing mechanism, file picker, or external storage. It exists only within the app's protected data directory for the duration of playback. Standard playback controls are preserved. Users initiate playback and can use play / pause / skip / seek — the same controls required by 4.5.2(i). No monetization of Apple Music access. The app does not charge for Apple Music playback, does not show ads around it, and does not collect or share user data. Our question Given that: Apple has no SDK presence on HarmonyOS, MusicKit JS DRM is technically non-functional on HarmonyOS WebView, the only way to deliver full-song playback to Apple Music subscribers on this platform is to decrypt the stream using the OS's native DRM (WisePlay) with strict ephemeral handling, is this playback approach acceptable under the Apple Developer Program License Agreement, provided that: decrypted content is never persisted, shared, or exposed to users, the app only serves subscribed Apple Music users with valid Music User Tokens, all usage remains within the scope of facilitating access to the user's own Apple Music subscription? We fully respect Apple's content protection requirements and are happy to adjust the implementation (e.g., stricter deletion timing, additional sandboxing, attestation) to comply. We just want to understand whether the fundamental approach — decrypting via the host OS's DRM because Apple's own CDMs are unavailable on this platform — is permissible, or whether Apple considers HarmonyOS out of scope for full-song playback entirely. Any guidance from the MusicKit team or community members who have dealt with non-Apple-platform constraints would be greatly appreciated. Thank you.
0
0
352
3w
Can an iOS app programmatically enable Voice Isolation microphone mode?
Hi, I’m developing an iOS app that captures the user’s voice and sends the microphone input to an AI model for speech processing. For this use case, Voice Isolation provides a significantly better input signal in noisy environments. However, I’m currently unable to enable Voice Isolation programmatically when the app starts recording. As I understand it, microphone modes such as Automatic, Standard, Voice Isolation, and Wide Spectrum are controlled by the user through the system UI. My app can detect/observe the current microphone mode, but I have not found a public API that allows the app to select Voice Isolation itself. My questions are: Is there currently a supported public API to programmatically switch the microphone mode from Automatic/Standard → Voice Isolation? If direct selection is not supported, is there a recommended way for an app that primarily processes speech/voice input for an AI model to request or prefer Voice Isolation? Would using AVAudioSession with an appropriate voice-processing configuration, such as .voiceChat, or enabling voice processing through AVAudioEngine, provide equivalent Voice Isolation processing? Is AVCaptureDevice.showSystemUserInterface(.microphoneModes) the intended approach when an app needs the user to change the microphone mode? I understand that Apple may intentionally keep microphone-mode selection under user control. I’m mainly trying to determine whether there is a supported programmatic approach that I may have overlooked, rather than relying on a custom noise-suppression implementation. Any guidance on the recommended architecture for this use case would be greatly appreciated. Thank you!
0
0
476
3w
AirPods Pro 3 Disconnecting from Apple Ultra 3 consistently
I have both apple devices, AirPods Pro 3 is up to date and Ultra 3 is on watch os 26.1 latest public beta. Each morning when I would go on my mindfulness app and start a meditation or listen to Apple Music on my watch and AirPods Pro 3, it will play for a few seconds then disconnects. My bluetooth settings on my watch says my AirPods is connected to my watch. I also have removed the tick about connecting automatically to iPhone on the AirPods setting in my iPhone. To fix this I invariably turn off my Apple Watch Ultra 3 and turn it on again. Then the connection becomes stable. I am not sure why I have to do this each morning. It is frustrating. I am not sure why this fix does not last long? Is there something wrong with my AirPods? Has anyone encountered this before?
2
1
1.5k
3w
iOS 27 CarPlay speaker issue
Connected my iphone 16 pro to my wireless carplay infotainment system, everything is okay but once a phonecall comes in, the audio just comes from one side of the car (passenger side). I've tried to connect my girlfriend's phone (non-apple) and it sounds fine with phone calls. I've tried resetting the systems on both the car and the phone. Music plays fine. Just the phone call situation is what is bothering at the moment.
0
0
319
3w
Can a MusicKit app add to the library without being the player?
Our macOS app uses MusicKit to search the Apple Music catalog and browse the customer's library. We are not using ApplicationMusicPlayer for playback. The customer's own Music app is the player, and our app is acting as a browser and remote for it. When the customer picks a catalog search result that is not already in their library, we would like to add it to their library, or to a playlist we create and clearly label as belonging to our app, so that it becomes playable from their library. Is using MusicLibrary to add a catalog item to the user's library a supported use of MusicKit in an app that does not itself play the content? Is creating and writing to a clearly labelled playlist of our own preferable to adding to the top-level library, or is either fine? Is there any supported way to hand a catalog item to the Music app for playback without adding it to the library first? We have tried open location with a music.apple.com URL, which opens the item's page but does not begin playback.
1
0
278
3w
Is MusicKit supported in a Mac app distributed outside the Mac App Store?
We are building a macOS application that we distribute directly from our website, signed with a Developer ID certificate and notarized. It is not on the Mac App Store and we do not plan to put it there. We want to add MusicKit so a customer can browse and play their own Apple Music library inside our app. We have the MusicKit App Service available to enable on an explicit App ID matching the app's bundle identifier, and we understand that MusicKit is not gated by an entitlement and that no private key is needed on Apple platforms. What we cannot find addressed anywhere is the distribution channel itself. Will MusicAuthorization.request and MusicLibraryRequest work in a Developer ID signed and notarized app distributed outside the Mac App Store, or does MusicKit require Mac App Store distribution?
0
0
263
3w
Apple Music real-time DJ mixing: is there an API or entitlement beyond MusicKit?
Hello, I am developing an iOS app that uses MusicKit and ApplicationMusicPlayer to create automatic transitions between songs from Apple Music. The app already analyzes tracks using BPM, musical key and danceability, orders them for compatible transitions, and uses MusicPlayer.Transition.crossfade for playback. With the public MusicKit APIs, however, I have reached a limitation. ApplicationMusicPlayer manages the playback queue and crossfade internally. I cannot independently control the outgoing and incoming Apple Music tracks as two decks, which would be required for DJ-style transitions (for example, starting the incoming track while independently controlling the outgoing track, choosing precise mix points, and managing the two playback positions during the overlap). I experimented with MusicPlayer.Queue.Entry startTime and endTime, but changing the end point is not equivalent to having independent deck control and can result in the current track ending before the desired transition. I understand that Apple Music content is protected and that direct access to decoded audio samples may intentionally not be available through the public MusicKit APIs. I am not looking to download, extract, record, or export Apple Music audio. My use case is real-time playback only, for authenticated Apple Music subscribers. My questions are: Is there a public API that allows two Apple Music tracks to be independently controlled and mixed in real time? If not, is there a restricted entitlement, API, or developer program available for DJ/mixing applications? If this capability requires a commercial or technical partnership with Apple Music rather than a public API, is there an official channel through which a developer can request or discuss such access? I am aware that some third-party DJ applications provide real-time mixing with Apple Music, so I would like to understand whether there is an officially supported integration path for other developers, rather than trying to work around the limitations of ApplicationMusicPlayer. Thank you.
0
1
625
Aug ’26
Logic Pro: Supported API or control-surface method for direct playhead navigation to project marker positions beyond marker 20
I am developing DOWNBEAT, a paid macOS Audio Unit plugin for Logic Pro live playback control. The plugin reads marker, tempo, and time signature data from a user-selected Logic Pro project and lets performers build a stage setlist. During live use, the performer needs to click a song in DOWNBEAT and have Logic Pro move the playhead directly to that song’s marker position. The current reliable method uses Logic Pro controller assignments mapped to “Go to Marker Number 1” through “Go to Marker Number 20.” This works for markers 1-20, but Logic Pro does not appear to expose direct “Go to Marker Number 21” or higher commands. I need to know whether Apple provides any supported public API, control-surface API, MIDI Device Script capability, Audio Unit host interaction, Apple Event, or other documented mechanism that allows a third-party macOS app/plugin to move Logic Pro’s playhead directly to a bar/beat position or marker position without opening a modal window. This is for live performance, so reliability is critical. Methods that open the “Go to Marker” or “Go to Position” window and type values are not acceptable, because they create visible UI interruptions during a show. What I have already tested: Logic Pro controller assignments: “Go to Marker Number 1” through “Go to Marker Number 20” work. “Go to Marker Number 21” does not appear to exist as a direct assignable command. Logic Pro MIDI Device Script / Lua control-surface script: I created a temporary MIDI Device Script that mapped a test control to “Go to Marker Number 1.” That worked. I then mapped another test control to “Go to Marker Number 21.” That did not work. I also tested “Go to Marker Number...” and it did not provide a usable direct non-modal workflow. MIDI Machine Control / SMPTE Locate: Logic received incoming MIDI, but location behavior was not reliable enough for live use. In multi-tempo projects, locate results could land incorrectly or cause visible playhead jumps. Logic Environment meta events: Tested incoming MIDI through the Logic Environment. MIDI was visible, but it did not provide reliable direct marker navigation. Mackie Control / MCU direction: Research suggests MCU marker commands do not provide direct absolute marker selection beyond the limited marker/function range. Specific questions: Is there a supported public way for a third-party macOS app, Audio Unit plugin, MIDI Device Script, or Logic Pro control-surface integration to set Logic Pro’s playhead directly to a specific bar/beat position? Is there a supported public way to trigger direct marker navigation beyond “Go to Marker Number 20” without opening a modal window? If the answer is no, is the recommended Apple-supported approach for this use case to limit direct marker navigation to the first 20 markers? Is there any supported Logic Pro control-surface API or developer program path that would allow this kind of direct live-performance marker navigation?
0
0
312
Aug ’26
Video recording goes fine but adding audio fails mysteriously
I'm trying to update an old unity app for a client. The app has been crashing on iOS in a plugin they use called NatCorder. They use it to record video only separately and then re-record it with effects and audio gathered separately. Instead of trying to update the plugin to something else which would be quite the hassle, I noticed the API for the native part of the plugin, where the crash occurs, is very simple, especially if you don't try to support everything the plugin does and the app does not use. So I tried to re-implement that native library using AVFoundation. I got the video recording right, it captures the camera from the iPhone and writes it to a file properly. However, when the app does the second part, where it sends video and audio frames to the plugin, it fails. The app sends all the video frames and then sends all the audio frames. The video frames are eaten fine by AVFoundation but the audio fails at random points with unknown errors. I wonder if I'm trying to use incompatible audio-video formats or if I'm using timestamps wrong or something. Here's my init code. Anything suspicious to you? void* NCCreateMP4Recorder(int width, int height, float framerate, int bitrate, int keyframeInterval, int sampleRate, int channelCount, const char* recordingPath, void (*callback)(void*, void*), void* context) { Recorder* recorder = calloc(1, sizeof(Recorder)); recorder->context = context; recorder->callback = callback; recorder->path = strdup(recordingPath); recorder->width = width; recorder->channelCount = channelCount; recorder->sampleRate = sampleRate; recorder->height = height; NSError *error = nil; NSURL* url = createURLFromArgumentCString(recordingPath); recorder->writer = [AVAssetWriter assetWriterWithURL:url fileType:AVFileTypeMPEG4 error:&error]; if (recorder->writer == nil) NSLog(@"Failed creating media writer: %@", error); NSDictionary *videoSettings = @{ AVVideoCodecKey: AVVideoCodecTypeH264, AVVideoWidthKey: @(width), AVVideoHeightKey: @(height), AVVideoCompressionPropertiesKey: @{ AVVideoAverageBitRateKey: @(bitrate), AVVideoMaxKeyFrameIntervalKey: @(keyframeInterval), } }; recorder->video = [AVAssetWriterInput assetWriterInputWithMediaType:AVMediaTypeVideo outputSettings:videoSettings]; if (recorder->video == nil) NSLog(@"Failed creating video writer input"); recorder->video.expectsMediaDataInRealTime = true; NSDictionary* videoSource = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:kCVPixelFormatType_32ARGB], kCVPixelBufferPixelFormatTypeKey, [NSNumber numberWithInt:width], kCVPixelBufferWidthKey, [NSNumber numberWithInt:height], kCVPixelBufferHeightKey, nil]; recorder->videoAdaptor = [AVAssetWriterInputPixelBufferAdaptor assetWriterInputPixelBufferAdaptorWithAssetWriterInput:recorder->video sourcePixelBufferAttributes:videoSource]; if (recorder->videoAdaptor == nil) NSLog(@"Failed creating video adaptor"); if ([recorder->writer canAddInput:recorder->video]) [recorder->writer addInput:recorder->video]; else NSLog(@"Could not add video input to writer"); if (sampleRate > 0 && channelCount > 0) { AudioChannelLayout layout = { .mChannelLayoutTag = channelCount == 1 ? kAudioChannelLayoutTag_Mono : kAudioChannelLayoutTag_Stereo, .mChannelBitmap = 0, .mNumberChannelDescriptions = 0 }; NSDictionary* audioOutputSettings = @{ AVFormatIDKey: @(kAudioFormatMPEG4AAC), AVNumberOfChannelsKey: @(channelCount), AVSampleRateKey: @(sampleRate), AVEncoderBitRateKey: @128000, AVChannelLayoutKey: [NSData dataWithBytes:&layout length:sizeof(layout)] }; recorder->audio = [AVAssetWriterInput assetWriterInputWithMediaType:AVMediaTypeAudio outputSettings:audioOutputSettings]; if (!recorder->audio) NSLog(@"Failed creating audio adaptor"); recorder->audio.expectsMediaDataInRealTime = true; AudioStreamBasicDescription audioStreamDesc = { .mSampleRate = sampleRate, .mFormatID = kAudioFormatLinearPCM, .mFormatFlags = kAudioFormatFlagIsPacked | kAudioFormatFlagIsFloat, .mBytesPerPacket = channelCount * sizeof(float), .mFramesPerPacket = 1, .mBytesPerFrame = channelCount * sizeof(float), .mChannelsPerFrame = channelCount, .mBitsPerChannel = sizeof(float) * 8, }; OSStatus status = CMAudioFormatDescriptionCreate(kCFAllocatorDefault, &audioStreamDesc, sizeof(layout), &layout, 0, nil, nil, &recorder->audioDesc); if (status) NSLog(@"Failed creating audio format description: %d", (int)status); if ([recorder->writer canAddInput:recorder->audio]) [recorder->writer addInput:recorder->audio]; else NSLog(@"Could not add audio input to writer"); } if (![recorder->writer startWriting]) NSLog(@"Could not start writing: %@", recorder->writer.error); [recorder->writer startSessionAtSourceTime:kCMTimeZero]; NSLog(@"Recording started to %s", recordingPath); return recorder; }
2
0
212
Aug ’26
Processing / tapping an HLS audio stream (or global app output)
I'm trying to do some realtime audio processing on audio served from an HLS stream (i.e. an AVPlayer created using an M3U HTTP URL). It doesn't seem like attaching an AVAudioMix configured with with an `audioTapProcessor` has any effect; none of the callbacks except `init` are being invoked. Is this a known limitation? If so, is this documented somewhere?If the above is a limitation, what are my options using some of the other audio APIs? I looked into `AVAudioEngine` as well but it doesn't seem like there's any way I can configure any of the input node types to use an HLS stream. Am I wrong? Are there lower level APIs available to play HLS streams that provide the necessary hooks?Alternatively, is there some generic way to tap into all audio being output by my app regardless of its source?Thanks a lot!
12
0
5.4k
Aug ’26
Preserve AirPods Transparency while capturing one AirPod microphone for low latency cross ear audio
I am prototyping an iOS accessibility audio application for people with unilateral hearing loss. The goal is simple. Capture environmental audio using the AirPod on the poor hearing side and route that audio with very low latency into the AirPod on the working hearing side. The core concept is already working on physical AirPods and an iPhone. Our desired signal path is Right AirPod microphone → iPhone audio processing → Left AirPod output The user sets the AirPods microphone in Settings to Always Right AirPod. The app then captures that Bluetooth microphone and routes the signal into the left output channel. Using AVAudioSession and AVAudioEngine we have successfully achieved low latency cross ear audio. The main issue is native AirPods Transparency. When the app activates the AirPods Bluetooth microphone using HFP, the transferred audio continues working correctly, but native Transparency audio on the receiving AirPod effectively disappears. Interestingly, iOS still reports Transparency as enabled in Control Center and AirPods settings. This means the user can hear audio transferred from the poor hearing side, but their working ear loses much of the normal environmental sound that Transparency previously provided. We have tested several configurations. Normal Bluetooth HFP with playAndRecord This provides the best result so far. The AirPods microphone signal is strong. The output route exposes two channels. We can route the microphone signal only to the opposite AirPod. Latency can be reduced enough that conversation feels nearly real time. However, native Transparency on the receiving AirPod effectively stops providing environmental audio. bluetoothHighQualityRecording Microphone quality is noticeably better. However, latency is significantly higher and produces an audible delayed or echo effect during conversation. Transparency has the same general issue. multiRoute with dualRoute This allows the iPhone audio hardware and AirPods to operate simultaneously. It appears to preserve more ambient awareness on the working side. However, the AirPods microphone becomes substantially weaker when used as the secondary Bluetooth HFP input. We measured the incoming AirPods microphone signal at roughly minus 40 dB during normal speech testing. Adding 12 to 18 dB of software gain increases distortion without materially improving intelligibility. farFieldInput with dualRoute We tested the raw AirPods microphone with and without farFieldInput. The microphone levels and practical pickup were very similar. Far field speech processing improved intelligibility somewhat, but did not solve the weak secondary Bluetooth input signal. Our main technical question is Is there a supported AVAudioSession configuration, Core Audio API, AirPods API, or entitlement that allows a third party application to capture an AirPods microphone while preserving the AirPods native Transparency processing on the output AirPod? Ideally we want Right AirPod microphone capture plus native Transparency on the left AirPod plus application generated right to left audio mixed into the left AirPod all operating simultaneously. We do not need access to Apple's Transparency microphone signal itself if native Transparency can simply remain active while our application audio is mixed into the receiving AirPod. If this is not currently possible using public APIs, is this an intentional platform limitation of the AirPods Bluetooth microphone route? We would also appreciate guidance on whether there is another recommended architecture for this accessibility use case. The low latency cross ear routing itself works surprisingly well. Preserving natural environmental audio in the user's working ear while the Bluetooth microphone is active is currently the main technical blocker. Testing has been performed on a physical iPhone running iOS 26.x using Xcode 26.6 and current AirPods hardware, not the Simulator. Thank you for any guidance.
0
0
182
Aug ’26
watchOS: Network framework WebSocket loses its path ~35 s in, while URLSession keeps working
Following up on TN3135 and the resolution in https://developer.apple.com/forums/thread/773362 — that thread solved establishing a low-level connection on watchOS (the asynchronous AVAudioSession.activate(options:completionHandler:) instead of the synchronous setActive()). This question is about a connection staying established, which I could not find discussed anywhere. Environment: Apple Watch, watchOS 26.6 (23U67). Audio app, WKBackgroundModes = ["self-care"]. Real device, TestFlight build, not the simulator. What works Opening an NWConnection WebSocket to my own server is reliable — 8 attempts out of 8 reached .ready in 0.28–0.98 s, and an echo frame round-tripped in 27–89 ms. Interestingly, in my measurements it opens under BOTH activation variants: the asynchronous activate(options:completionHandler:) AND the synchronous setActive(true). The two are within ~0.2 s of each other. I mention it only because the thread above concluded the synchronous one is insufficient; on 26.6 I cannot reproduce that difference for establishment. What fails The connection goes quiet after roughly half a minute, and an NWPathMonitor running alongside it shows why: the path transitions to .unsatisfied. Four runs: +34.0 s (cellular) +34.6 s (cellular) +36.0 s (Wi-Fi) +34.3 s (companion link only — availableInterfaces ["other", "other"]) The server sends a heartbeat frame every 5 s and closes the socket on a schedule, so I can tell "the peer closed" from "we stopped receiving". The client receives beats 1–6 (5 s … 30 s) and then nothing; the scheduled close never arrives. What I ruled out Server side. The same client construction run on macOS against the same endpoint receives all 8 heartbeats and the scheduled close at 45.1 s. Both audio-session activation variants — no difference, as above. Network type — cellular, Wi-Fi and companion-link-only all drop at ~35 s. The app being suspended. The app keeps logging densely throughout, and in the last run it held a WKExtendedRuntimeSession (delegate reported extendedRuntimeSessionDidStart) and was actively playing audio through AVAudioEngine from the first second — i.e. the audio-streaming condition TN3135 describes — for the entire window. The path dropped anyway, at +34.3 s. An idle socket. Server traffic arrives every 5 s until the drop. The comparison that puzzles me The same app, on the same watch, the same afternoon, relays the same realtime audio session over plain HTTPS (URLSession) instead — and that runs for 64 s continuously without a stall, including straight through a WatchConnectivity "reachability settled: unreachable" transition. So a high-level URLSession request stream survives a period in which a low-level NWConnection's path is reported unsatisfied. That is consistent with the note in thread 773362 that "on watchOS every session is kinda like a background session, where the actual work is done out of process" — but it leaves me unsure what the intended behaviour is. Questions Is a ~35 s path lifetime the expected behaviour for low-level networking on watchOS, or does it indicate something wrong on my side? Does the TN3135 audio-streaming exception cover only the establishment of a low-level connection, or is it also supposed to keep the path available for the duration of the audio streaming? If it is supposed to persist: is there something beyond an active audio session, flowing audio and a WKExtendedRuntimeSession that an app must do to keep the path alive? If ~35 s is the expected ceiling, is a WebSocket a supported transport for a multi-minute conversational audio session on watchOS at all — or is relaying over URLSession the intended approach despite the guidance to prefer Network framework? Happy to file a bug with a sysdiagnose and a reduced sample project if that is more useful — please say the word and I will attach the numbers above.
4
0
1.3k
Aug ’26
Setting appEntityIdentifiers on Now Playing content from a RemoteMediaSessionExtension
I'm using the new RemoteMediaSession API (iOS 27) to surface a remote device's playback (network speakers) on the Lock Screen / Control Center. I'd like to link the presented MusicContent to my App Intents entities so Siri can answer "what's playing?" / "tell me more about this artist," using appEntityIdentifiers. The problem: that property is unavailable in extensions. @available(iOSApplicationExtension, unavailable) extension MediaContentRepresentable { public var appEntityIdentifiers: [EntityIdentifier] { get set } } Result: an extension-hosted remote session seems to have no supported way to attach App Intents entity identifiers to its content. A local MediaSession can set it, but only while the app is running. Questions: Is there a supported way to associate appEntityIdentifiers with RemoteMediaSession content that I'm missing? If not, is this an intentional limitation? I've filed an enhancement request — FB24301827. Any guidance appreciated. Thanks!
0
0
455
Aug ’26
MacOS Music App Returning 404 to Play Next Commands from iTunes Remote app
MacOS Music App No Longer Accepts "Play Next" and "Add to Up Next" from iTunes Remote app. Connect to your library through the iTunes Remote App. Navigate to a song within the iOS iTunes Remote App and press and hold on the song and when the action sheet comes up select "Play Next" or "Add to Up Next". View the MacOS Music App's Playing Next queue to discover that the additions were not made. Thanks for any help you can provide on this. I'd really love to see this working again. I captured network traffic (tcpdump) between the iTunes Remote iOS app and Music.app on macOS 26 (Tahoe). When tapping "Play Next" on a track, the Remote app sends: GET /ctrl-int/1/playqueue-edit?command=add&query='dmap.itemid:27387'&sort=album&mode=3 Music.app responds with HTTP 404 Not Found. "Add to Up Next" sends the same endpoint with mode=0 and also receives 404 Not Found. Other Remote app functions work correctly over the same connection (play/pause, skip), browsing the library, and viewing the queue all return successful responses. Only the queue-add operation returns 404.
0
0
532
Aug ’26
Volumes issue
My volume will randomly go all the way down to mute or all the way up to full blast while I’m listen to music, watching a video, playing a game. I have all the volume safety features turned off. Does anyone else have this issue?
Replies
1
Boosts
0
Views
424
Activity
3w
Does the TN3135 audio-session networking exception have a defined lifetime? Seeing a ~38.5 s revoke/re-grant cycle
TN3135 describes the exception that lets a watchOS app use low-level networking while it holds an active audio session. I have that working, and the app functions — but the network path is withdrawn and restored on a strikingly regular cycle, and I would like to know whether that is expected behaviour rather than something I am doing wrong. Setup Apple Watch Series 10 (Watch7,9), watchOS 26.5. Reproduced on a Series 6 (Watch6,2). UIBackgroundModes: [audio]; AVAudioSession category .playAndRecord, mode .spokenAudio; activated with the async activate(options:completionHandler:). NWConnection with NWProtocolWebSocket to a WebSocket relay over TLS. The app streams 16 kHz mono PCM continuously while transmitting and holds the socket open otherwise. Symptom NWPathMonitor reports .unsatisfied, then .satisfied about two seconds later, over and over. Measured with the iPhone powered off, so the watch was on its own Wi-Fi: Uptime between drops Outage 36.4 s 2.1 s 36.7 s 1.9 s 36.9 s 2.1 s The regularity is what prompts the question — uptime varies by ±0.3 s and the outage is consistently 2.0 s. That reads as a timeout expiring rather than radio behaviour. What I have ruled out Not the network or the server. A browser client on the same relay, same TLS, same wire protocol, holds a WebSocket indefinitely. Not the interface. Identical cadence over the companion ipsec1 tunnel with the iPhone present, and over the watch's own en0 with the iPhone powered off. Pinning requiredInterfaceType = .wifi while the iPhone is reachable fails outright — the path offers only ipsec1. Not audio-session interruption. I observe interruptionNotification, routeChangeNotification, mediaServicesWereResetNotification and silenceSecondaryAudioHintNotification. None fire at a drop. At the moment the path goes .unsatisfied, the engine is running and the player node is actively playing. Not session idleness. Playing continuous silence for the whole session, rather than only while reconnecting, made no difference — still 36.4 s. The control that surprised me To test whether this affects any long-lived watch socket or only audio-unlocked ones, I built a second app with no AVAudioSession at all, no audio background mode, holding a URLSessionWebSocketTask and kept alive by a WKExtendedRuntimeSession so screen sleep was not a factor. It never connected. NWPathMonitor reported .unsatisfied once and never changed, across a 30 s run, and every request failed with "The Internet connection appears to be offline." I had expected URLSession to be permitted regardless. Questions Does the audio-session networking exception in TN3135 have a defined lifetime, and is a periodic revoke/re-grant cycle expected? If so, is there a supported way to hold it continuously — or is the correct design simply to expect the interruption and reconnect through it? Is it expected that an app with no audio session gets no network path at all on watchOS, including via URLSession, even in the foreground with an extended runtime session?
Replies
16
Boosts
0
Views
3.6k
Activity
3w
AirPods Sleep Detection pauses meditation playback with no API/callback to identify the reason
Good morning! I work on a meditation app, and since Sleep Detection was introduced for AirPods in iOS 26, we've been receiving complaints from users reporting that their meditation sessions unexpectedly stop after approximately 15–20 minutes when Sleep Detection is enabled. This seems to happen particularly during deep meditation sessions, where the user may remain still and exhibit behavior that could potentially be interpreted as falling asleep. I've also tested this on iOS 27 with the latest beta firmware available for AirPods Pro, and the same behavior still occurs. While investigating and debugging the issue, I found that there doesn't appear to be any public API that allows an app to determine that playback was paused specifically because of AirPods Sleep Detection. From the application's perspective, the AirPods appear to simply send a standard pause command to the AVPlayer, without providing any additional context or reason. There also doesn't seem to be an API that allows us to determine whether the user has Sleep Detection enabled. Even having access to that information would allow us to warn users that their meditation session could potentially be interrupted. AVAudioSession.InterruptionReason does not seem to help in this case either: https://developer.apple.com/documentation/avfaudio/avaudiosession/interruptionreason Is there currently any supported way for an app to: Detect that playback was paused specifically because of AirPods Sleep Detection? Determine whether Sleep Detection is enabled for the connected AirPods? Prevent Sleep Detection from pausing playback for specific apps or specific types of audio sessions? If none of these are currently possible, could Apple consider providing either a notification/callback indicating that Sleep Detection triggered the pause, or an option for users to exclude specific apps from Sleep Detection? This behavior is particularly problematic for meditation apps, since a user in a deep meditation session can easily be mistaken for someone who has fallen asleep. Other meditation apps appear to be affected by the same behavior as well. Best regards, Carlos Antunes
Replies
1
Boosts
0
Views
1k
Activity
3w
MusicKit on HarmonyOS — playback approach for a platform without an official SDK, licensing question
Hello Apple Developer community, I'm building an Apple Music client for HarmonyOS (Huawei's operating system) and would like to clarify the licensing and technical approach before submitting to a third-party app store (Huawei AppGallery). I've read the Apple Developer Program License Agreement and App Store Review Guideline 4.5.2, but there are platform-specific constraints I'd like to discuss. Background Apple currently does not provide a MusicKit SDK for HarmonyOS. The available options are: MusicKit for iOS/macOS — not applicable (different OS) MusicKit for Android — ships as proprietary .aar binaries that cannot be redistributed and are not compatible with HarmonyOS's runtime MusicKit JS — available, but HarmonyOS WebView does not support FairPlay or Widevine EME, so full-song DRM playback through MusicKit JS does not work on this platform The only Apple Music API access path available to a HarmonyOS app is the REST API (api.music.apple.com) with a Developer Token (JWT, ES256) and a Music User Token obtained through the MusicKit JS authorization flow running inside a WebView. The technical constraint To deliver full-song playback for subscribed Apple Music users on HarmonyOS, our app retrieves the HLS playback URL via the Apple Music API, downloads the encrypted media segments, and decrypts them using HarmonyOS's native DRM system (WisePlay, the only CDM available on the platform). MusicKit JS's FairPlay/Widevine CDM is not compatible with HarmonyOS — WisePlay is the sole DRM implementation the OS exposes. We are aware that Section 4.5.2 states: "You may not, and You may not permit Your end users to, download, upload, or modify any MusicKit Content" and "You may play MusicKit Content only as rendered by the MusicKit APIs or MusicKit JS" What we want to clarify Our playback implementation works as follows, and we want to confirm whether it is acceptable under the license terms: No download service is offered to users. The download is purely an internal playback mechanism — the app fetches encrypted segments, decrypts them in memory / a protected sandbox, and plays them via the system AVPlayer. There is no "download button," no offline library, no user-facing download feature. Decrypted files are ephemeral and protected. Decrypted media is written to the app's private sandbox (not accessible to users or other apps), played immediately, and deleted as soon as playback ends or the song is skipped. The decrypted file never persists beyond the current playback session. No file leakage. The decrypted content is never exposed via any sharing mechanism, file picker, or external storage. It exists only within the app's protected data directory for the duration of playback. Standard playback controls are preserved. Users initiate playback and can use play / pause / skip / seek — the same controls required by 4.5.2(i). No monetization of Apple Music access. The app does not charge for Apple Music playback, does not show ads around it, and does not collect or share user data. Our question Given that: Apple has no SDK presence on HarmonyOS, MusicKit JS DRM is technically non-functional on HarmonyOS WebView, the only way to deliver full-song playback to Apple Music subscribers on this platform is to decrypt the stream using the OS's native DRM (WisePlay) with strict ephemeral handling, is this playback approach acceptable under the Apple Developer Program License Agreement, provided that: decrypted content is never persisted, shared, or exposed to users, the app only serves subscribed Apple Music users with valid Music User Tokens, all usage remains within the scope of facilitating access to the user's own Apple Music subscription? We fully respect Apple's content protection requirements and are happy to adjust the implementation (e.g., stricter deletion timing, additional sandboxing, attestation) to comply. We just want to understand whether the fundamental approach — decrypting via the host OS's DRM because Apple's own CDMs are unavailable on this platform — is permissible, or whether Apple considers HarmonyOS out of scope for full-song playback entirely. Any guidance from the MusicKit team or community members who have dealt with non-Apple-platform constraints would be greatly appreciated. Thank you.
Replies
0
Boosts
0
Views
352
Activity
3w
Can an iOS app programmatically enable Voice Isolation microphone mode?
Hi, I’m developing an iOS app that captures the user’s voice and sends the microphone input to an AI model for speech processing. For this use case, Voice Isolation provides a significantly better input signal in noisy environments. However, I’m currently unable to enable Voice Isolation programmatically when the app starts recording. As I understand it, microphone modes such as Automatic, Standard, Voice Isolation, and Wide Spectrum are controlled by the user through the system UI. My app can detect/observe the current microphone mode, but I have not found a public API that allows the app to select Voice Isolation itself. My questions are: Is there currently a supported public API to programmatically switch the microphone mode from Automatic/Standard → Voice Isolation? If direct selection is not supported, is there a recommended way for an app that primarily processes speech/voice input for an AI model to request or prefer Voice Isolation? Would using AVAudioSession with an appropriate voice-processing configuration, such as .voiceChat, or enabling voice processing through AVAudioEngine, provide equivalent Voice Isolation processing? Is AVCaptureDevice.showSystemUserInterface(.microphoneModes) the intended approach when an app needs the user to change the microphone mode? I understand that Apple may intentionally keep microphone-mode selection under user control. I’m mainly trying to determine whether there is a supported programmatic approach that I may have overlooked, rather than relying on a custom noise-suppression implementation. Any guidance on the recommended architecture for this use case would be greatly appreciated. Thank you!
Replies
0
Boosts
0
Views
476
Activity
3w
AirPods Pro 3 Disconnecting from Apple Ultra 3 consistently
I have both apple devices, AirPods Pro 3 is up to date and Ultra 3 is on watch os 26.1 latest public beta. Each morning when I would go on my mindfulness app and start a meditation or listen to Apple Music on my watch and AirPods Pro 3, it will play for a few seconds then disconnects. My bluetooth settings on my watch says my AirPods is connected to my watch. I also have removed the tick about connecting automatically to iPhone on the AirPods setting in my iPhone. To fix this I invariably turn off my Apple Watch Ultra 3 and turn it on again. Then the connection becomes stable. I am not sure why I have to do this each morning. It is frustrating. I am not sure why this fix does not last long? Is there something wrong with my AirPods? Has anyone encountered this before?
Replies
2
Boosts
1
Views
1.5k
Activity
3w
iOS 27 CarPlay speaker issue
Connected my iphone 16 pro to my wireless carplay infotainment system, everything is okay but once a phonecall comes in, the audio just comes from one side of the car (passenger side). I've tried to connect my girlfriend's phone (non-apple) and it sounds fine with phone calls. I've tried resetting the systems on both the car and the phone. Music plays fine. Just the phone call situation is what is bothering at the moment.
Replies
0
Boosts
0
Views
319
Activity
3w
Can a MusicKit app add to the library without being the player?
Our macOS app uses MusicKit to search the Apple Music catalog and browse the customer's library. We are not using ApplicationMusicPlayer for playback. The customer's own Music app is the player, and our app is acting as a browser and remote for it. When the customer picks a catalog search result that is not already in their library, we would like to add it to their library, or to a playlist we create and clearly label as belonging to our app, so that it becomes playable from their library. Is using MusicLibrary to add a catalog item to the user's library a supported use of MusicKit in an app that does not itself play the content? Is creating and writing to a clearly labelled playlist of our own preferable to adding to the top-level library, or is either fine? Is there any supported way to hand a catalog item to the Music app for playback without adding it to the library first? We have tried open location with a music.apple.com URL, which opens the item's page but does not begin playback.
Replies
1
Boosts
0
Views
278
Activity
3w
Is MusicKit supported in a Mac app distributed outside the Mac App Store?
We are building a macOS application that we distribute directly from our website, signed with a Developer ID certificate and notarized. It is not on the Mac App Store and we do not plan to put it there. We want to add MusicKit so a customer can browse and play their own Apple Music library inside our app. We have the MusicKit App Service available to enable on an explicit App ID matching the app's bundle identifier, and we understand that MusicKit is not gated by an entitlement and that no private key is needed on Apple platforms. What we cannot find addressed anywhere is the distribution channel itself. Will MusicAuthorization.request and MusicLibraryRequest work in a Developer ID signed and notarized app distributed outside the Mac App Store, or does MusicKit require Mac App Store distribution?
Replies
0
Boosts
0
Views
263
Activity
3w
Apple Music real-time DJ mixing: is there an API or entitlement beyond MusicKit?
Hello, I am developing an iOS app that uses MusicKit and ApplicationMusicPlayer to create automatic transitions between songs from Apple Music. The app already analyzes tracks using BPM, musical key and danceability, orders them for compatible transitions, and uses MusicPlayer.Transition.crossfade for playback. With the public MusicKit APIs, however, I have reached a limitation. ApplicationMusicPlayer manages the playback queue and crossfade internally. I cannot independently control the outgoing and incoming Apple Music tracks as two decks, which would be required for DJ-style transitions (for example, starting the incoming track while independently controlling the outgoing track, choosing precise mix points, and managing the two playback positions during the overlap). I experimented with MusicPlayer.Queue.Entry startTime and endTime, but changing the end point is not equivalent to having independent deck control and can result in the current track ending before the desired transition. I understand that Apple Music content is protected and that direct access to decoded audio samples may intentionally not be available through the public MusicKit APIs. I am not looking to download, extract, record, or export Apple Music audio. My use case is real-time playback only, for authenticated Apple Music subscribers. My questions are: Is there a public API that allows two Apple Music tracks to be independently controlled and mixed in real time? If not, is there a restricted entitlement, API, or developer program available for DJ/mixing applications? If this capability requires a commercial or technical partnership with Apple Music rather than a public API, is there an official channel through which a developer can request or discuss such access? I am aware that some third-party DJ applications provide real-time mixing with Apple Music, so I would like to understand whether there is an officially supported integration path for other developers, rather than trying to work around the limitations of ApplicationMusicPlayer. Thank you.
Replies
0
Boosts
1
Views
625
Activity
Aug ’26
iOS27 Callkit's didActivateAudioSession not being called sometimes
I have not seen any issues with didActivateAudioSession not getting called by iOS in many many years with many thousands of devices. However with iOS27 beta code I have seen a few times that when making an outgoing call it never gets called. All subsequent outgoing calls fail until I dismiss and relaunch the App.
Replies
19
Boosts
0
Views
3.0k
Activity
Aug ’26
Logic Pro: Supported API or control-surface method for direct playhead navigation to project marker positions beyond marker 20
I am developing DOWNBEAT, a paid macOS Audio Unit plugin for Logic Pro live playback control. The plugin reads marker, tempo, and time signature data from a user-selected Logic Pro project and lets performers build a stage setlist. During live use, the performer needs to click a song in DOWNBEAT and have Logic Pro move the playhead directly to that song’s marker position. The current reliable method uses Logic Pro controller assignments mapped to “Go to Marker Number 1” through “Go to Marker Number 20.” This works for markers 1-20, but Logic Pro does not appear to expose direct “Go to Marker Number 21” or higher commands. I need to know whether Apple provides any supported public API, control-surface API, MIDI Device Script capability, Audio Unit host interaction, Apple Event, or other documented mechanism that allows a third-party macOS app/plugin to move Logic Pro’s playhead directly to a bar/beat position or marker position without opening a modal window. This is for live performance, so reliability is critical. Methods that open the “Go to Marker” or “Go to Position” window and type values are not acceptable, because they create visible UI interruptions during a show. What I have already tested: Logic Pro controller assignments: “Go to Marker Number 1” through “Go to Marker Number 20” work. “Go to Marker Number 21” does not appear to exist as a direct assignable command. Logic Pro MIDI Device Script / Lua control-surface script: I created a temporary MIDI Device Script that mapped a test control to “Go to Marker Number 1.” That worked. I then mapped another test control to “Go to Marker Number 21.” That did not work. I also tested “Go to Marker Number...” and it did not provide a usable direct non-modal workflow. MIDI Machine Control / SMPTE Locate: Logic received incoming MIDI, but location behavior was not reliable enough for live use. In multi-tempo projects, locate results could land incorrectly or cause visible playhead jumps. Logic Environment meta events: Tested incoming MIDI through the Logic Environment. MIDI was visible, but it did not provide reliable direct marker navigation. Mackie Control / MCU direction: Research suggests MCU marker commands do not provide direct absolute marker selection beyond the limited marker/function range. Specific questions: Is there a supported public way for a third-party macOS app, Audio Unit plugin, MIDI Device Script, or Logic Pro control-surface integration to set Logic Pro’s playhead directly to a specific bar/beat position? Is there a supported public way to trigger direct marker navigation beyond “Go to Marker Number 20” without opening a modal window? If the answer is no, is the recommended Apple-supported approach for this use case to limit direct marker navigation to the first 20 markers? Is there any supported Logic Pro control-surface API or developer program path that would allow this kind of direct live-performance marker navigation?
Replies
0
Boosts
0
Views
312
Activity
Aug ’26
Apple Music for DJ App
Hi there, I recently launched a dj app to the mac app store, and was wondering how I could access songs for mixing purposes via Apple Music just like how serato, rekordbox, djay, and other DJ apps do? Thanks, Gunek
Replies
1
Boosts
0
Views
1.7k
Activity
Aug ’26
Video recording goes fine but adding audio fails mysteriously
I'm trying to update an old unity app for a client. The app has been crashing on iOS in a plugin they use called NatCorder. They use it to record video only separately and then re-record it with effects and audio gathered separately. Instead of trying to update the plugin to something else which would be quite the hassle, I noticed the API for the native part of the plugin, where the crash occurs, is very simple, especially if you don't try to support everything the plugin does and the app does not use. So I tried to re-implement that native library using AVFoundation. I got the video recording right, it captures the camera from the iPhone and writes it to a file properly. However, when the app does the second part, where it sends video and audio frames to the plugin, it fails. The app sends all the video frames and then sends all the audio frames. The video frames are eaten fine by AVFoundation but the audio fails at random points with unknown errors. I wonder if I'm trying to use incompatible audio-video formats or if I'm using timestamps wrong or something. Here's my init code. Anything suspicious to you? void* NCCreateMP4Recorder(int width, int height, float framerate, int bitrate, int keyframeInterval, int sampleRate, int channelCount, const char* recordingPath, void (*callback)(void*, void*), void* context) { Recorder* recorder = calloc(1, sizeof(Recorder)); recorder->context = context; recorder->callback = callback; recorder->path = strdup(recordingPath); recorder->width = width; recorder->channelCount = channelCount; recorder->sampleRate = sampleRate; recorder->height = height; NSError *error = nil; NSURL* url = createURLFromArgumentCString(recordingPath); recorder->writer = [AVAssetWriter assetWriterWithURL:url fileType:AVFileTypeMPEG4 error:&error]; if (recorder->writer == nil) NSLog(@"Failed creating media writer: %@", error); NSDictionary *videoSettings = @{ AVVideoCodecKey: AVVideoCodecTypeH264, AVVideoWidthKey: @(width), AVVideoHeightKey: @(height), AVVideoCompressionPropertiesKey: @{ AVVideoAverageBitRateKey: @(bitrate), AVVideoMaxKeyFrameIntervalKey: @(keyframeInterval), } }; recorder->video = [AVAssetWriterInput assetWriterInputWithMediaType:AVMediaTypeVideo outputSettings:videoSettings]; if (recorder->video == nil) NSLog(@"Failed creating video writer input"); recorder->video.expectsMediaDataInRealTime = true; NSDictionary* videoSource = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:kCVPixelFormatType_32ARGB], kCVPixelBufferPixelFormatTypeKey, [NSNumber numberWithInt:width], kCVPixelBufferWidthKey, [NSNumber numberWithInt:height], kCVPixelBufferHeightKey, nil]; recorder->videoAdaptor = [AVAssetWriterInputPixelBufferAdaptor assetWriterInputPixelBufferAdaptorWithAssetWriterInput:recorder->video sourcePixelBufferAttributes:videoSource]; if (recorder->videoAdaptor == nil) NSLog(@"Failed creating video adaptor"); if ([recorder->writer canAddInput:recorder->video]) [recorder->writer addInput:recorder->video]; else NSLog(@"Could not add video input to writer"); if (sampleRate > 0 && channelCount > 0) { AudioChannelLayout layout = { .mChannelLayoutTag = channelCount == 1 ? kAudioChannelLayoutTag_Mono : kAudioChannelLayoutTag_Stereo, .mChannelBitmap = 0, .mNumberChannelDescriptions = 0 }; NSDictionary* audioOutputSettings = @{ AVFormatIDKey: @(kAudioFormatMPEG4AAC), AVNumberOfChannelsKey: @(channelCount), AVSampleRateKey: @(sampleRate), AVEncoderBitRateKey: @128000, AVChannelLayoutKey: [NSData dataWithBytes:&layout length:sizeof(layout)] }; recorder->audio = [AVAssetWriterInput assetWriterInputWithMediaType:AVMediaTypeAudio outputSettings:audioOutputSettings]; if (!recorder->audio) NSLog(@"Failed creating audio adaptor"); recorder->audio.expectsMediaDataInRealTime = true; AudioStreamBasicDescription audioStreamDesc = { .mSampleRate = sampleRate, .mFormatID = kAudioFormatLinearPCM, .mFormatFlags = kAudioFormatFlagIsPacked | kAudioFormatFlagIsFloat, .mBytesPerPacket = channelCount * sizeof(float), .mFramesPerPacket = 1, .mBytesPerFrame = channelCount * sizeof(float), .mChannelsPerFrame = channelCount, .mBitsPerChannel = sizeof(float) * 8, }; OSStatus status = CMAudioFormatDescriptionCreate(kCFAllocatorDefault, &audioStreamDesc, sizeof(layout), &layout, 0, nil, nil, &recorder->audioDesc); if (status) NSLog(@"Failed creating audio format description: %d", (int)status); if ([recorder->writer canAddInput:recorder->audio]) [recorder->writer addInput:recorder->audio]; else NSLog(@"Could not add audio input to writer"); } if (![recorder->writer startWriting]) NSLog(@"Could not start writing: %@", recorder->writer.error); [recorder->writer startSessionAtSourceTime:kCMTimeZero]; NSLog(@"Recording started to %s", recordingPath); return recorder; }
Replies
2
Boosts
0
Views
212
Activity
Aug ’26
Processing / tapping an HLS audio stream (or global app output)
I'm trying to do some realtime audio processing on audio served from an HLS stream (i.e. an AVPlayer created using an M3U HTTP URL). It doesn't seem like attaching an AVAudioMix configured with with an `audioTapProcessor` has any effect; none of the callbacks except `init` are being invoked. Is this a known limitation? If so, is this documented somewhere?If the above is a limitation, what are my options using some of the other audio APIs? I looked into `AVAudioEngine` as well but it doesn't seem like there's any way I can configure any of the input node types to use an HLS stream. Am I wrong? Are there lower level APIs available to play HLS streams that provide the necessary hooks?Alternatively, is there some generic way to tap into all audio being output by my app regardless of its source?Thanks a lot!
Replies
12
Boosts
0
Views
5.4k
Activity
Aug ’26
Preserve AirPods Transparency while capturing one AirPod microphone for low latency cross ear audio
I am prototyping an iOS accessibility audio application for people with unilateral hearing loss. The goal is simple. Capture environmental audio using the AirPod on the poor hearing side and route that audio with very low latency into the AirPod on the working hearing side. The core concept is already working on physical AirPods and an iPhone. Our desired signal path is Right AirPod microphone → iPhone audio processing → Left AirPod output The user sets the AirPods microphone in Settings to Always Right AirPod. The app then captures that Bluetooth microphone and routes the signal into the left output channel. Using AVAudioSession and AVAudioEngine we have successfully achieved low latency cross ear audio. The main issue is native AirPods Transparency. When the app activates the AirPods Bluetooth microphone using HFP, the transferred audio continues working correctly, but native Transparency audio on the receiving AirPod effectively disappears. Interestingly, iOS still reports Transparency as enabled in Control Center and AirPods settings. This means the user can hear audio transferred from the poor hearing side, but their working ear loses much of the normal environmental sound that Transparency previously provided. We have tested several configurations. Normal Bluetooth HFP with playAndRecord This provides the best result so far. The AirPods microphone signal is strong. The output route exposes two channels. We can route the microphone signal only to the opposite AirPod. Latency can be reduced enough that conversation feels nearly real time. However, native Transparency on the receiving AirPod effectively stops providing environmental audio. bluetoothHighQualityRecording Microphone quality is noticeably better. However, latency is significantly higher and produces an audible delayed or echo effect during conversation. Transparency has the same general issue. multiRoute with dualRoute This allows the iPhone audio hardware and AirPods to operate simultaneously. It appears to preserve more ambient awareness on the working side. However, the AirPods microphone becomes substantially weaker when used as the secondary Bluetooth HFP input. We measured the incoming AirPods microphone signal at roughly minus 40 dB during normal speech testing. Adding 12 to 18 dB of software gain increases distortion without materially improving intelligibility. farFieldInput with dualRoute We tested the raw AirPods microphone with and without farFieldInput. The microphone levels and practical pickup were very similar. Far field speech processing improved intelligibility somewhat, but did not solve the weak secondary Bluetooth input signal. Our main technical question is Is there a supported AVAudioSession configuration, Core Audio API, AirPods API, or entitlement that allows a third party application to capture an AirPods microphone while preserving the AirPods native Transparency processing on the output AirPod? Ideally we want Right AirPod microphone capture plus native Transparency on the left AirPod plus application generated right to left audio mixed into the left AirPod all operating simultaneously. We do not need access to Apple's Transparency microphone signal itself if native Transparency can simply remain active while our application audio is mixed into the receiving AirPod. If this is not currently possible using public APIs, is this an intentional platform limitation of the AirPods Bluetooth microphone route? We would also appreciate guidance on whether there is another recommended architecture for this accessibility use case. The low latency cross ear routing itself works surprisingly well. Preserving natural environmental audio in the user's working ear while the Bluetooth microphone is active is currently the main technical blocker. Testing has been performed on a physical iPhone running iOS 26.x using Xcode 26.6 and current AirPods hardware, not the Simulator. Thank you for any guidance.
Replies
0
Boosts
0
Views
182
Activity
Aug ’26
watchOS: Network framework WebSocket loses its path ~35 s in, while URLSession keeps working
Following up on TN3135 and the resolution in https://developer.apple.com/forums/thread/773362 — that thread solved establishing a low-level connection on watchOS (the asynchronous AVAudioSession.activate(options:completionHandler:) instead of the synchronous setActive()). This question is about a connection staying established, which I could not find discussed anywhere. Environment: Apple Watch, watchOS 26.6 (23U67). Audio app, WKBackgroundModes = ["self-care"]. Real device, TestFlight build, not the simulator. What works Opening an NWConnection WebSocket to my own server is reliable — 8 attempts out of 8 reached .ready in 0.28–0.98 s, and an echo frame round-tripped in 27–89 ms. Interestingly, in my measurements it opens under BOTH activation variants: the asynchronous activate(options:completionHandler:) AND the synchronous setActive(true). The two are within ~0.2 s of each other. I mention it only because the thread above concluded the synchronous one is insufficient; on 26.6 I cannot reproduce that difference for establishment. What fails The connection goes quiet after roughly half a minute, and an NWPathMonitor running alongside it shows why: the path transitions to .unsatisfied. Four runs: +34.0 s (cellular) +34.6 s (cellular) +36.0 s (Wi-Fi) +34.3 s (companion link only — availableInterfaces ["other", "other"]) The server sends a heartbeat frame every 5 s and closes the socket on a schedule, so I can tell "the peer closed" from "we stopped receiving". The client receives beats 1–6 (5 s … 30 s) and then nothing; the scheduled close never arrives. What I ruled out Server side. The same client construction run on macOS against the same endpoint receives all 8 heartbeats and the scheduled close at 45.1 s. Both audio-session activation variants — no difference, as above. Network type — cellular, Wi-Fi and companion-link-only all drop at ~35 s. The app being suspended. The app keeps logging densely throughout, and in the last run it held a WKExtendedRuntimeSession (delegate reported extendedRuntimeSessionDidStart) and was actively playing audio through AVAudioEngine from the first second — i.e. the audio-streaming condition TN3135 describes — for the entire window. The path dropped anyway, at +34.3 s. An idle socket. Server traffic arrives every 5 s until the drop. The comparison that puzzles me The same app, on the same watch, the same afternoon, relays the same realtime audio session over plain HTTPS (URLSession) instead — and that runs for 64 s continuously without a stall, including straight through a WatchConnectivity "reachability settled: unreachable" transition. So a high-level URLSession request stream survives a period in which a low-level NWConnection's path is reported unsatisfied. That is consistent with the note in thread 773362 that "on watchOS every session is kinda like a background session, where the actual work is done out of process" — but it leaves me unsure what the intended behaviour is. Questions Is a ~35 s path lifetime the expected behaviour for low-level networking on watchOS, or does it indicate something wrong on my side? Does the TN3135 audio-streaming exception cover only the establishment of a low-level connection, or is it also supposed to keep the path available for the duration of the audio streaming? If it is supposed to persist: is there something beyond an active audio session, flowing audio and a WKExtendedRuntimeSession that an app must do to keep the path alive? If ~35 s is the expected ceiling, is a WebSocket a supported transport for a multi-minute conversational audio session on watchOS at all — or is relaying over URLSession the intended approach despite the guidance to prefer Network framework? Happy to file a bug with a sysdiagnose and a reduced sample project if that is more useful — please say the word and I will attach the numbers above.
Replies
4
Boosts
0
Views
1.3k
Activity
Aug ’26
Setting appEntityIdentifiers on Now Playing content from a RemoteMediaSessionExtension
I'm using the new RemoteMediaSession API (iOS 27) to surface a remote device's playback (network speakers) on the Lock Screen / Control Center. I'd like to link the presented MusicContent to my App Intents entities so Siri can answer "what's playing?" / "tell me more about this artist," using appEntityIdentifiers. The problem: that property is unavailable in extensions. @available(iOSApplicationExtension, unavailable) extension MediaContentRepresentable { public var appEntityIdentifiers: [EntityIdentifier] { get set } } Result: an extension-hosted remote session seems to have no supported way to attach App Intents entity identifiers to its content. A local MediaSession can set it, but only while the app is running. Questions: Is there a supported way to associate appEntityIdentifiers with RemoteMediaSession content that I'm missing? If not, is this an intentional limitation? I've filed an enhancement request — FB24301827. Any guidance appreciated. Thanks!
Replies
0
Boosts
0
Views
455
Activity
Aug ’26
Is there any supported API for a third party app to access live audio from a call it isn't itself carrying?
Is there any supported API for a third party app to access live audio from a call it isn't itself carrying?
Replies
1
Boosts
0
Views
895
Activity
Aug ’26
MacOS Music App Returning 404 to Play Next Commands from iTunes Remote app
MacOS Music App No Longer Accepts "Play Next" and "Add to Up Next" from iTunes Remote app. Connect to your library through the iTunes Remote App. Navigate to a song within the iOS iTunes Remote App and press and hold on the song and when the action sheet comes up select "Play Next" or "Add to Up Next". View the MacOS Music App's Playing Next queue to discover that the additions were not made. Thanks for any help you can provide on this. I'd really love to see this working again. I captured network traffic (tcpdump) between the iTunes Remote iOS app and Music.app on macOS 26 (Tahoe). When tapping "Play Next" on a track, the Remote app sends: GET /ctrl-int/1/playqueue-edit?command=add&query='dmap.itemid:27387'&sort=album&mode=3 Music.app responds with HTTP 404 Not Found. "Add to Up Next" sends the same endpoint with mode=0 and also receives 404 Not Found. Other Remote app functions work correctly over the same connection (play/pause, skip), browsing the library, and viewing the queue all return successful responses. Only the queue-add operation returns 404.
Replies
0
Boosts
0
Views
532
Activity
Aug ’26