AudioToolbox

RSS for tag

Record or play audio convert formats parse audio streams and configure your audio session using AudioToolbox.

Posts under AudioToolbox tag

135 Posts

Post

Replies

Boosts

Views

Activity

kAudioUnitSubType_VoiceProcessingIO volume really low with specific devices
I am trying to setup a kAudioUnitSubType_VoiceProcessingIO audio unit for a VoIP macOS app. I tried kAudioUnitSubType_HALOutput first, but it was not suitable due to echo and noise, which makes sense. kAudioUnitSubType_VoiceProcessingIO seemed promising. However, when using it with a bluetooth headset for output and built-in mic for input, volume gets really low compared to other device setups such as both internal input and output, or both bluetooth headset input and output. The alternative setups seem to work fine, but we can't request users to avoid specific setups. This makes kAudioUnitSubType_VoiceProcessingIO unusable for a macOS app. Is kAudioUnitSubType_VoiceProcessingIO production ready for current macOS apps? Is there any way to avoid the volume issues? Adding manual gain is not a workaround because voice becomes really distorted. Thanks.
1
0
1.3k
Jul ’23
Logic Pro, SIGSEV, critical crashes
Hi, I'm working hard with Logic Pro and it's the 4th time that the application crashes. This is report I receive. What can I do to fix? Thank you in advance Translated Report (Full Report Below) Process: Logic Pro X [1433] Path: /Applications/Logic Pro X.app/Contents/MacOS/Logic Pro X Identifier: com.apple.logic10 Version: 10.7.7 (5762) Build Info: MALogic-5762000000000000~2 (1A85) App Item ID: 634148309 App External ID: 854029738 Code Type: X86-64 (Native) Parent Process: launchd [1] User ID: 501 Date/Time: 2023-07-01 09:16:42.7422 +0200 OS Version: macOS 13.3.1 (22E261) Report Version: 12 Bridge OS Version: 7.4 (20P4252) Anonymous UUID: F5E0021C-707D-3E26-12BC-6E1D779A746A Time Awake Since Boot: 2700 seconds System Integrity Protection: enabled Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000010 Exception Codes: 0x0000000000000001, 0x0000000000000010 Termination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11 Terminating Process: exc handler [1433] VM Region Info: 0x10 is not in any region. Bytes before following region: 140737486778352 REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL UNUSED SPACE AT START ---> shared memory 7fffffe7f000-7fffffe80000 [ 4K] r-x/r-x SM=SHM Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 Logic Pro X 0x108fe6972 0x108a75000 + 5708146 1 Logic Pro X 0x108def2d3 0x108a75000 + 3646163 2 Foundation 0x7ff80e4b3f35 __NSFireDelayedPerform + 440 3 CoreFoundation 0x7ff80d623478 CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION + 20 4 CoreFoundation 0x7ff80d622ff3 __CFRunLoopDoTimer + 807 5 CoreFoundation 0x7ff80d622c19 __CFRunLoopDoTimers + 285 6 CoreFoundation 0x7ff80d608f79 __CFRunLoopRun + 2206 7 CoreFoundation 0x7ff80d608071 CFRunLoopRunSpecific + 560 8 HIToolbox 0x7ff817070fcd RunCurrentEventLoopInMode + 292 9 HIToolbox 0x7ff817070dde ReceiveNextEventCommon + 657 10 HIToolbox 0x7ff817070b38 _BlockUntilNextEventMatchingListInModeWithFilter + 64 11 AppKit 0x7ff81069a7a0 _DPSNextEvent + 858 12 AppKit 0x7ff81069964a -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1214 13 Logic Pro X 0x10a29885d 0x108a75000 + 25311325 14 MAToolKit 0x1117f0e37 0x1116ec000 + 1068599 15 MAToolKit 0x1117f64ae 0x1116ec000 + 1090734 16 AppKit 0x7ff8108864b1 -[NSWindow(NSEventRouting) _handleMouseDownEvent:isDelayedEvent:] + 4330 17 AppKit 0x7ff8107fdcef -[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] + 404 18 AppKit 0x7ff8107fd93f -[NSWindow(NSEventRouting) sendEvent:] + 345 19 Logic Pro X 0x108ebf486 0x108a75000 + 4498566 20 AppKit 0x7ff8107fc319 -[NSApplication(NSEvent) sendEvent:] + 345 21 Logic Pro X 0x10a2995f4 0x108a75000 + 25314804 22 Logic Pro X 0x10a2990c9 0x108a75000 + 25313481 23 Logic Pro X 0x10a29337f 0x108a75000 + 25289599 24 Logic Pro X 0x10a29962e 0x108a75000 + 25314862 25 Logic Pro X 0x10a2990c9 0x108a75000 + 25313481 26 AppKit 0x7ff810ab6bbe -[NSApplication _handleEvent:] + 65 27 AppKit 0x7ff81068bcdd -[NSApplication run] + 623 28 AppKit 0x7ff81065fed2 NSApplicationMain + 817 29 Logic Pro X 0x10956565d 0x108a75000 + 11470429 30 dyld 0x7ff80d1d441f start + 1903 Thread 1:: caulk.messenger.shared:17 0 libsystem_kernel.dylib 0x7ff80d4ef52e semaphore_wait_trap + 10 1 caulk 0x7ff816da707e caulk::semaphore::timed_wait(double) + 150 2 caulk 0x7ff816da6f9c caulk::concurrent::details::worker_thread::run() + 30 3 caulk 0x7ff816da6cb0 void* caulk::thread_proxy<std::__1::tuple<caulk::thread::attributes, void (caulk::concurrent::details::worker_thread::)(), std::__1::tuplecaulk::concurrent::details::worker_thread*>>(void) + 41 4 libsystem_pthread.dylib 0x7ff80d52e1d3 _pthread_start + 125 5 libsystem_pthread.dylib 0x7ff80d529bd3 thread_start + 15 Thread 2:: com.apple.NSEventThread 0 libsystem_kernel.dylib 0x7ff80d4ef5b2 mach_msg2_trap + 10 1 libsystem_kernel.dylib 0x7ff80d4fd72d mach_msg2_internal + 78 2 libsystem_kernel.dylib 0x7ff80d4f65e4 mach_msg_overwrite + 692 3 libsystem_kernel.dylib 0x7ff80d4ef89a mach_msg + 19 4 SkyLight 0x7ff81219f7ac CGSSnarfAndDispatchDatagrams + 160 5 SkyLight 0x7ff8124b8cfd SLSGetNextEventRecordInternal + 284 6 SkyLight 0x7ff8122d8360 SLEventCreateNextEvent + 9 7 HIToolbox 0x7ff81707bfea PullEventsFromWindowServerOnConnection(unsigned int, unsigned char, __CFMachPortBoost*) + 45 8 HIToolbox 0x7ff81707bf8b MessageHandler(__CFMachPort*, void*, long, void*) + 48 9 CoreFoundation 0x7ff80d637e66 __CFMachPortPerform + 244 10 CoreFoundation 0x7ff80d60a5a3 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION + 41 11 CoreFoundation 0x7ff80d60a4e3 __CFRunLoopDoSource1 + 540 12 CoreFoundation 0x7ff80d609161 __CFRunLoopRun + 2694 13 CoreFoundation 0x7ff80d608071 CFRunLoopRunSpecific + 560 14 AppKit 0x7ff8107fa909 _NSEventThread + 132 15 libsystem_pthread.dylib 0x7ff80d52e1d3 _pthread_start + 125 16 libsystem_pthread.dylib 0x7ff80d529bd3 thread_start + 15
0
0
1k
Jul ’23
Realtime audio processing within an AudioQueue
How can I processing on the AudioQueue callback AudioQueueOutputCallback for FFT . Just like this func static void audioQueueOutpuCallBack(void *input, AudioQueueRef inQueue, AudioQueueBufferRef outQueueBuffer) {    SYAudioQueue *aq = (__bridge SYAudioQueue *)input;   dispatch_semaphore_wait(aq-m_mutex, DISPATCH_TIME_FOREVER);   [aq enterQueue:inQueue withBuffer:outQueueBuffer];   dispatch_semaphore_signal(aq-m_mutex); } I know that AVAudioEngine can be processing for FFT under the AVAudioPCMBuffer . or How can I convert AudioQueueBufferRef to AVAudioPCMBuffer
1
0
1.5k
Jun ’23
Call Recording in IOS 2023
hi I know there's many ways to record Voice in IOS by using one of these famous framework : AVFoundation AudioToolbox Core Audio but what I want todo is to be able record a phone call but there's many challenges interruptions : when I got a call the system interrupt any running app in order to handle this call so how I can I make the voice recording app record voice in background so after I receive a call I open the app and run the record function even though I solved the previous issue , how can I record the sound comes from the phone top speaker if anyone have an idea or any thoughts , please share it with me
1
0
1.7k
May ’23
Using kAudioDevicePropertyIcon to get the icon of an audio device produces status: 2003332927
Hi, I am developing a macOS application in SwiftUI (Xcode Version 14.3 (14E222b)) which lets the users control the audio level (volume) of the running applications individually, and also enables them to change the default speaker of each running application by letting them select an audio device from a list of available audio devices connected to the Mac. Till now, I have been able to get the following: List of running applications using NSWorkspace.shared.runningApplications The default audio device using kAudioHardwarePropertyDefaultOutputDevice with id and name List of audio devices using kAudioHardwarePropertyDevices with ids and names I am trying to get the icon of the devices using kAudioDevicePropertyIcon, but it is not working. I have written the following program to achieve the same: var deviceIcon: CFTypeRef? var deviceIconSize = UInt32(MemoryLayout<CFTypeRef>.size) var deviceIconPropertyAddress = AudioObjectPropertyAddress( mSelector: kAudioDevicePropertyIcon, mScope: kAudioObjectPropertyScopeGlobal, mElement: defaultOutputDeviceID) var status = AudioObjectGetPropertyData( defaultOutputDeviceID, &deviceIconPropertyAddress, 0, nil, &deviceIconSize, &deviceIcon) guard status == noErr else { print("Error getting default output device icon: \(status)") return } When I run the above program, I get the following output: Error getting default output device icon: 2003332927 defaultOutputDeviceID is the id of the default audio device. For now, I am just trying to get the icon of the default speaker which, in my case, is MacBook Air Speakers. I have tried searching for this status code, and I found that this error is defined in AudioFile.h as kAudioFileUnspecifiedError = 'wht?', // 0x7768743F, 2003334207. Does this mean that there is no icon for the specified deviceID, or is there something wrong with my program? Could someone please let me know how to resolve this error? Thank you!
0
0
1.9k
Apr ’23
AAC decoding with Audio Toolbox is failing in Monterey RC
When I use Audio Toolbox APIs to decode AAC audio, I am getting kAudioConverterErr_FormatNotSupported(1718449215) error. This works fine in BigSur(11.5.2) and previous versions. prompt> ./ffmpeg -c:a aac_at -i audio24b_he_aac.aac -f s16le -acodec pcm_s16le output.pcm -v trace ffmpeg version N-104401-gcd38fbf4f7 Copyright (c) 2000-2021 the FFmpeg developers  built with Apple clang version 13.0.0 (clang-1300.0.29.3)  configuration: --disable-x86asm  libavutil   57. 7.100 / 57. 7.100  libavcodec   59. 12.100 / 59. 12.100  libavformat  59. 6.100 / 59. 6.100  libavdevice  59. 0.101 / 59. 0.101  libavfilter   8. 15.100 / 8. 15.100  libswscale   6. 1.100 / 6. 1.100  libswresample  4. 0.100 / 4. 0.100 Splitting the commandline. Reading option '-c:a' ... matched as option 'c' (codec name) with argument 'aac_at'. Reading option '-i' ... matched as input url with argument 'audio24b_he_aac.aac'. Reading option '-f' ... matched as option 'f' (force format) with argument 's16le'. Reading option '-acodec' ... matched as option 'acodec' (force audio codec ('copy' to copy stream)) with argument 'pcm_s16le'. Reading option 'output.pcm' ... matched as output url. Reading option '-v' ... matched as option 'v' (set logging level) with argument 'trace'. Finished splitting the commandline. Parsing a group of options: global . Applying option v (set logging level) with argument trace. Successfully parsed a group of options. Parsing a group of options: input url audio24b_he_aac.aac. Applying option c:a (codec name) with argument aac_at. Successfully parsed a group of options. Opening an input file: audio24b_he_aac.aac. [NULL @ 0x7f8cf4004d40] Opening 'audio24b_he_aac.aac' for reading [file @ 0x7f8cf4005180] Setting default whitelist 'file,crypto,data' Probing aac score:51 size:2048 [aac @ 0x7f8cf4004d40] Format aac probed with size=2048 and score=51 [aac @ 0x7f8cf4004d40] Before avformat_find_stream_info() pos: 0 bytes read:65696 seeks:4 nb_streams:1 [aac_at @ 0x7f8cf40057c0] AudioToolbox init error: 1718449215 [aac @ 0x7f8cf4004d40] All info found [aac @ 0x7f8cf4004d40] Estimating duration from bitrate, this may be inaccurate Following lines of code is failing. status = AudioConverterNew(&in_format, &out_format, &at->converter); if (status != 0) { av_log(avctx, AV_LOG_ERROR, "AudioToolbox init error: %i\n", (int)status); return AVERROR_UNKNOWN; } Is there any change with respect to these APIs in Monterey. I could not find any thing in the documentation or release notes.
1
0
2.1k
Mar ’23
Audio input bandwidth
My app samples the various inputs available on the iPhone and iPad and performs a frequency analysis. In addition to using the internal accelerometer and gyroscope I can also sample the microphone and USB input devices such as accelerometers through the audio input subsystem. The highest sample rate I use with the microphone and USB devices is the 48 KHz of the audio sampling subsystem. This provides a bandwidth of 24 kHz (Nyquist frequency) on the sampled signal. This has worked for many generations of iPhone and iPad until now. When I use my iPhone 14 Pro there is a sharp frequency cutoff at about 8 kHz. I see an artifact at the same frequency when I use the simulators. BUT when I use my 11" iPad Pro, or my current generation iPhone SE I do not see this effect and get good data out to 24 kHz. The iPad Pro does show some rolloff near 24 kHz which is noticeable but not a problem for most applications. The rolloff at 8 kHz is a serious problem for my customers who are testing equipment vibration and noise. I am wondering if this is related to the new microphone options "Standard", "Voice Isolation", and "Wide Spectrum". But if so, why only on the iPhone 14Pro and the simulators? I have searched the documentation but apparently it is not possible to programmatically change the microphone mode and the Apple documentation on how to use this new feature is lacking. I am using AVAudioSession and AVAudioRecorder methods to acquire the data through the audio capture hardware. This code has been working well for me for over 10 years so I do not think it is a code problem but it could be a configuration problem because of new hardware in the iPhone 14 although I have not found anything in the documentation. Examples from various devices and a simulator are shown below for microphone. Does anyone have an idea what may be causing this problem? iPhoneSE 3rd Gen iPad Gen 9 iPad Pro 11in iPhone 14Pro iPad 10th Generation Simulator
0
0
1.2k
Mar ’23
Starting recording from background for a VoIP application.
After searching for a few days, i have come to know that iOS doesn't allow recording in background. Through recording continues when it has started in foreground and goes to background. Came to know that, "This is a new a privacy protection restriction introduced in 12.4" When trying to start recording from background, we get “AVAudioSession.ErrorCode.cannotStartRecording” error. What do i need: our application needs to starts recording audio and transmit it while in background when user presses an external button i.e. PTT button of a BLE device. It seems there are several similar issue posted in this forum but neither could i find any plausible solution nor got any specific documentation from Apple. Requesting to help me out or at least please provide me a specific documentation stating "background recording is not possible". And if any workaround exists, please suggest. P.S. we are using **AVAudioSession.sharedInstance().setCategory(.playAndRecord, mode: .spokenAudio, options: [.mixWithOthers, .allowBluetooth, .allowBluetoothA2DP, .duckOthers]) **
0
0
1.2k
Feb ’23
core audio API library
I have a High Sierra system which I access via ssh and for which I program old-style from the command line in Objective-C and build via Makefiles. I have a very small program that employs the CoreAudio API and calls the AudioFileOpenURL and AudioFileClose functions. The program compiles ok but the linker is reporting that the symbols AudioFileOpenURL and AudioFileClose are undefined. I cannot find any dylib file among the libraries on my system that has those symbols. Can someone suggest where I might obtain the appropriate library? Here is the linker output that I am getting: gcc -o example1 example1.o -lobjc -lextension Undefined symbols for architecture x86_64: "_AudioFileClose", referenced from: _main in example1.o "_AudioFileGetProperty", referenced from: _main in example1.o "_AudioFileGetPropertyInfo", referenced from: _main in example1.o "_AudioFileOpenURL", referenced from: _main in example1.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [example1] Error 1
1
0
1k
Feb ’23
Write AAC files in a way that they are readable even in a crash
I'm building an audio recording app. For our users it's important that recordings never get lost - even if the app crashes, users would like to have the partial recording. We encode recordings in AAC or ALAC and store them in an m4a file using AVAudioFile. However, in case the app crashes, those m4a files are invalid - the MOOV atom is missing. Are there recording settings that change the m4a file so that it is always playable, even if the recording is interrupted half-way? I'm not at all an expert in audio codecs, but from what I understand, it is possible to write the MOOV atom at the beginning of the audio file instead of the end. This could solve this. But of course, I'd prefer an actual expert to tell me what a good solution is, and how to configure this in AVAudioFile.
3
1
2.0k
Feb ’23
Writing tapped buffers to disk asynchronously
I'd like to understand the most robust way to record audio to disk using AVAudioNodes installTap(onBus:bufferSize:format:block:) method. Currently, I'm dispatching out the buffers I receive in my AVAudioNodeTapBlock to a serial dispatch queue then writing to disk using some Audio Toolbox methods, but my concern is that if I hold on to the buffer provided in the AVAudioNodeTapBlock for too long (due to disk I/O for example), I'll end up getting issues. What I'm considering is creating my own larger pool of preallocated AVAudioPCMBuffers (a few seconds worth) and copying across the data from the buffer provided by the tap into one of the buffers from this larger pool in the AVAudioNodeTapBlock directly (no dispatch queue). Is there a simpler way of handling this, or does this sound like the best route?
1
0
971
Feb ’23
Low level audio recording on macOS. Please Help!
I am struggling to see why the following low-level audio recording function - which is based on tn2091 - Device input using the HAL Output Audio Unit - (a great article, btw, although a bit dated, and it would be wonderful if it was updated to use Swift and non deprecated stuff at some point!) fails to work under macOS: func createMicUnit() -> AUAudioUnit { let compDesc = AudioComponentDescription( componentType: kAudioUnitType_Output, componentSubType: kAudioUnitSubType_HALOutput, // I am on macOS, os this is good componentManufacturer: kAudioUnitManufacturer_Apple, componentFlags: 0, componentFlagsMask: 0) return try! AUAudioUnit(componentDescription: compDesc, options: []) } func startMic() { // mic permision is already granted at this point, but let's check let status = AVCaptureDevice.authorizationStatus(for: AVMediaType.audio) precondition(status == .authorized) // yes, all good let unit = createMicUnit() unit.isInputEnabled = true unit.isOutputEnabled = false precondition(!unit.canPerformInput) // can't record yet, and know why? print(deviceName(unit.deviceID)) // "MacBook Pro Speakers" - this is why let micDeviceID = defaultInputDeviceID print(deviceName(micDeviceID)) // "MacBook Pro Microphone" - this is better try! unit.setDeviceID(micDeviceID) // let's switch device to mic precondition(unit.canPerformInput) // now we can record print("\(String(describing: unit.channelMap))") // channel map is "nil" by default unit.channelMap = [0] // not sure if this helps or not let sampleRate = deviceActualFrameRate(micDeviceID) print(sampleRate) // 48000.0 let format = AVAudioFormat( commonFormat: .pcmFormatFloat32, sampleRate: sampleRate, channels: 1, interleaved: false)! try! unit.outputBusses[1].setFormat(format) unit.inputHandler = { flags, timeStamp, frameCount, bus in fatalError("never gets here") // now the weird part - this is never called! } try! unit.allocateRenderResources() try! unit.startHardware() // let's go! print("mic should be working now... why it doesn't?") // from now on the (UI) app continues its normal run loop } All sanity checks pass with flying colors but unit's inputHandler is not being called. Any idea why? Thank you!
3
0
2.1k
Jan ’23
MIDI file generated by using MusicSequenceFileCreate has Sysex MIDI message (iOS 16.0.2)
I am using the MusicSequenceFileCreate method to generate a MIDI file from a beat-based MusicSequence. In iOS 16.0.2 devices, the file that is created has a Sysex MIDI message added (not by me) to the file at time 0: f0 2a 11 67 40 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff ff ff ff 00 00 00 00 00 00 00 00 00 00 f7 Sysex messages are manufacturer dependent, a file with this Sysex message can't be read into apps like Nanostudio, Ableton, Zenbeats. It can be read by GarageBand. My app's deployment target is iOS 13.0. Has anybody else ran into this issue? Thanks
1
0
1.2k
Oct ’22
kAudioUnitSubType_VoiceProcessingIO volume really low with specific devices
I am trying to setup a kAudioUnitSubType_VoiceProcessingIO audio unit for a VoIP macOS app. I tried kAudioUnitSubType_HALOutput first, but it was not suitable due to echo and noise, which makes sense. kAudioUnitSubType_VoiceProcessingIO seemed promising. However, when using it with a bluetooth headset for output and built-in mic for input, volume gets really low compared to other device setups such as both internal input and output, or both bluetooth headset input and output. The alternative setups seem to work fine, but we can't request users to avoid specific setups. This makes kAudioUnitSubType_VoiceProcessingIO unusable for a macOS app. Is kAudioUnitSubType_VoiceProcessingIO production ready for current macOS apps? Is there any way to avoid the volume issues? Adding manual gain is not a workaround because voice becomes really distorted. Thanks.
Replies
1
Boosts
0
Views
1.3k
Activity
Jul ’23
Logic Pro, SIGSEV, critical crashes
Hi, I'm working hard with Logic Pro and it's the 4th time that the application crashes. This is report I receive. What can I do to fix? Thank you in advance Translated Report (Full Report Below) Process: Logic Pro X [1433] Path: /Applications/Logic Pro X.app/Contents/MacOS/Logic Pro X Identifier: com.apple.logic10 Version: 10.7.7 (5762) Build Info: MALogic-5762000000000000~2 (1A85) App Item ID: 634148309 App External ID: 854029738 Code Type: X86-64 (Native) Parent Process: launchd [1] User ID: 501 Date/Time: 2023-07-01 09:16:42.7422 +0200 OS Version: macOS 13.3.1 (22E261) Report Version: 12 Bridge OS Version: 7.4 (20P4252) Anonymous UUID: F5E0021C-707D-3E26-12BC-6E1D779A746A Time Awake Since Boot: 2700 seconds System Integrity Protection: enabled Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000010 Exception Codes: 0x0000000000000001, 0x0000000000000010 Termination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11 Terminating Process: exc handler [1433] VM Region Info: 0x10 is not in any region. Bytes before following region: 140737486778352 REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL UNUSED SPACE AT START ---> shared memory 7fffffe7f000-7fffffe80000 [ 4K] r-x/r-x SM=SHM Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 Logic Pro X 0x108fe6972 0x108a75000 + 5708146 1 Logic Pro X 0x108def2d3 0x108a75000 + 3646163 2 Foundation 0x7ff80e4b3f35 __NSFireDelayedPerform + 440 3 CoreFoundation 0x7ff80d623478 CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION + 20 4 CoreFoundation 0x7ff80d622ff3 __CFRunLoopDoTimer + 807 5 CoreFoundation 0x7ff80d622c19 __CFRunLoopDoTimers + 285 6 CoreFoundation 0x7ff80d608f79 __CFRunLoopRun + 2206 7 CoreFoundation 0x7ff80d608071 CFRunLoopRunSpecific + 560 8 HIToolbox 0x7ff817070fcd RunCurrentEventLoopInMode + 292 9 HIToolbox 0x7ff817070dde ReceiveNextEventCommon + 657 10 HIToolbox 0x7ff817070b38 _BlockUntilNextEventMatchingListInModeWithFilter + 64 11 AppKit 0x7ff81069a7a0 _DPSNextEvent + 858 12 AppKit 0x7ff81069964a -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1214 13 Logic Pro X 0x10a29885d 0x108a75000 + 25311325 14 MAToolKit 0x1117f0e37 0x1116ec000 + 1068599 15 MAToolKit 0x1117f64ae 0x1116ec000 + 1090734 16 AppKit 0x7ff8108864b1 -[NSWindow(NSEventRouting) _handleMouseDownEvent:isDelayedEvent:] + 4330 17 AppKit 0x7ff8107fdcef -[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] + 404 18 AppKit 0x7ff8107fd93f -[NSWindow(NSEventRouting) sendEvent:] + 345 19 Logic Pro X 0x108ebf486 0x108a75000 + 4498566 20 AppKit 0x7ff8107fc319 -[NSApplication(NSEvent) sendEvent:] + 345 21 Logic Pro X 0x10a2995f4 0x108a75000 + 25314804 22 Logic Pro X 0x10a2990c9 0x108a75000 + 25313481 23 Logic Pro X 0x10a29337f 0x108a75000 + 25289599 24 Logic Pro X 0x10a29962e 0x108a75000 + 25314862 25 Logic Pro X 0x10a2990c9 0x108a75000 + 25313481 26 AppKit 0x7ff810ab6bbe -[NSApplication _handleEvent:] + 65 27 AppKit 0x7ff81068bcdd -[NSApplication run] + 623 28 AppKit 0x7ff81065fed2 NSApplicationMain + 817 29 Logic Pro X 0x10956565d 0x108a75000 + 11470429 30 dyld 0x7ff80d1d441f start + 1903 Thread 1:: caulk.messenger.shared:17 0 libsystem_kernel.dylib 0x7ff80d4ef52e semaphore_wait_trap + 10 1 caulk 0x7ff816da707e caulk::semaphore::timed_wait(double) + 150 2 caulk 0x7ff816da6f9c caulk::concurrent::details::worker_thread::run() + 30 3 caulk 0x7ff816da6cb0 void* caulk::thread_proxy<std::__1::tuple<caulk::thread::attributes, void (caulk::concurrent::details::worker_thread::)(), std::__1::tuplecaulk::concurrent::details::worker_thread*>>(void) + 41 4 libsystem_pthread.dylib 0x7ff80d52e1d3 _pthread_start + 125 5 libsystem_pthread.dylib 0x7ff80d529bd3 thread_start + 15 Thread 2:: com.apple.NSEventThread 0 libsystem_kernel.dylib 0x7ff80d4ef5b2 mach_msg2_trap + 10 1 libsystem_kernel.dylib 0x7ff80d4fd72d mach_msg2_internal + 78 2 libsystem_kernel.dylib 0x7ff80d4f65e4 mach_msg_overwrite + 692 3 libsystem_kernel.dylib 0x7ff80d4ef89a mach_msg + 19 4 SkyLight 0x7ff81219f7ac CGSSnarfAndDispatchDatagrams + 160 5 SkyLight 0x7ff8124b8cfd SLSGetNextEventRecordInternal + 284 6 SkyLight 0x7ff8122d8360 SLEventCreateNextEvent + 9 7 HIToolbox 0x7ff81707bfea PullEventsFromWindowServerOnConnection(unsigned int, unsigned char, __CFMachPortBoost*) + 45 8 HIToolbox 0x7ff81707bf8b MessageHandler(__CFMachPort*, void*, long, void*) + 48 9 CoreFoundation 0x7ff80d637e66 __CFMachPortPerform + 244 10 CoreFoundation 0x7ff80d60a5a3 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION + 41 11 CoreFoundation 0x7ff80d60a4e3 __CFRunLoopDoSource1 + 540 12 CoreFoundation 0x7ff80d609161 __CFRunLoopRun + 2694 13 CoreFoundation 0x7ff80d608071 CFRunLoopRunSpecific + 560 14 AppKit 0x7ff8107fa909 _NSEventThread + 132 15 libsystem_pthread.dylib 0x7ff80d52e1d3 _pthread_start + 125 16 libsystem_pthread.dylib 0x7ff80d529bd3 thread_start + 15
Replies
0
Boosts
0
Views
1k
Activity
Jul ’23
How to disable AGC using the AUv3 API
To my knowledge, you can use the AudioUnitSetProperty function to set the kAUVoiceIOProperty_VoiceProcessingEnableAGC property to disable AGC in AUv2. However there is no equivalent functionality available in AUv3. The closest option I found is the shouldBypassEffect property. How to disable AGC using the AUv3 API ?
Replies
0
Boosts
0
Views
1.2k
Activity
Jun ’23
How can I build a system audio streamer macos app
Building an audio streamer macOS app to record system audio and other inputs/outputs: seeking guidance on frameworks and APIs to use. Need suggestions for capturing and saving audio data efficiently. Any recommendations or insights?
Replies
0
Boosts
0
Views
920
Activity
Jun ’23
Realtime audio processing within an AudioQueue
How can I processing on the AudioQueue callback AudioQueueOutputCallback for FFT . Just like this func static void audioQueueOutpuCallBack(void *input, AudioQueueRef inQueue, AudioQueueBufferRef outQueueBuffer) {    SYAudioQueue *aq = (__bridge SYAudioQueue *)input;   dispatch_semaphore_wait(aq-m_mutex, DISPATCH_TIME_FOREVER);   [aq enterQueue:inQueue withBuffer:outQueueBuffer];   dispatch_semaphore_signal(aq-m_mutex); } I know that AVAudioEngine can be processing for FFT under the AVAudioPCMBuffer . or How can I convert AudioQueueBufferRef to AVAudioPCMBuffer
Replies
1
Boosts
0
Views
1.5k
Activity
Jun ’23
Call Recording in IOS 2023
hi I know there's many ways to record Voice in IOS by using one of these famous framework : AVFoundation AudioToolbox Core Audio but what I want todo is to be able record a phone call but there's many challenges interruptions : when I got a call the system interrupt any running app in order to handle this call so how I can I make the voice recording app record voice in background so after I receive a call I open the app and run the record function even though I solved the previous issue , how can I record the sound comes from the phone top speaker if anyone have an idea or any thoughts , please share it with me
Replies
1
Boosts
0
Views
1.7k
Activity
May ’23
Using kAudioDevicePropertyIcon to get the icon of an audio device produces status: 2003332927
Hi, I am developing a macOS application in SwiftUI (Xcode Version 14.3 (14E222b)) which lets the users control the audio level (volume) of the running applications individually, and also enables them to change the default speaker of each running application by letting them select an audio device from a list of available audio devices connected to the Mac. Till now, I have been able to get the following: List of running applications using NSWorkspace.shared.runningApplications The default audio device using kAudioHardwarePropertyDefaultOutputDevice with id and name List of audio devices using kAudioHardwarePropertyDevices with ids and names I am trying to get the icon of the devices using kAudioDevicePropertyIcon, but it is not working. I have written the following program to achieve the same: var deviceIcon: CFTypeRef? var deviceIconSize = UInt32(MemoryLayout<CFTypeRef>.size) var deviceIconPropertyAddress = AudioObjectPropertyAddress( mSelector: kAudioDevicePropertyIcon, mScope: kAudioObjectPropertyScopeGlobal, mElement: defaultOutputDeviceID) var status = AudioObjectGetPropertyData( defaultOutputDeviceID, &deviceIconPropertyAddress, 0, nil, &deviceIconSize, &deviceIcon) guard status == noErr else { print("Error getting default output device icon: \(status)") return } When I run the above program, I get the following output: Error getting default output device icon: 2003332927 defaultOutputDeviceID is the id of the default audio device. For now, I am just trying to get the icon of the default speaker which, in my case, is MacBook Air Speakers. I have tried searching for this status code, and I found that this error is defined in AudioFile.h as kAudioFileUnspecifiedError = 'wht?', // 0x7768743F, 2003334207. Does this mean that there is no icon for the specified deviceID, or is there something wrong with my program? Could someone please let me know how to resolve this error? Thank you!
Replies
0
Boosts
0
Views
1.9k
Activity
Apr ’23
AVAudioUnitTimePitch has a render latency
AVAudioUnitTimePitch.latency is 0.09s on my debug devices. It will have a little time delay during render audio using `AVAudioEngine. I just want to change the pitch during playing audio. So how can I avoid this this latency??
Replies
1
Boosts
0
Views
1.9k
Activity
Mar ’23
Can the app access the voice files in the system voice memos?
I want to implement a function that can read the recording files in voice memos, is there any way other than using iOS Share Extension?
Replies
1
Boosts
0
Views
1.2k
Activity
Mar ’23
AAC decoding with Audio Toolbox is failing in Monterey RC
When I use Audio Toolbox APIs to decode AAC audio, I am getting kAudioConverterErr_FormatNotSupported(1718449215) error. This works fine in BigSur(11.5.2) and previous versions. prompt> ./ffmpeg -c:a aac_at -i audio24b_he_aac.aac -f s16le -acodec pcm_s16le output.pcm -v trace ffmpeg version N-104401-gcd38fbf4f7 Copyright (c) 2000-2021 the FFmpeg developers  built with Apple clang version 13.0.0 (clang-1300.0.29.3)  configuration: --disable-x86asm  libavutil   57. 7.100 / 57. 7.100  libavcodec   59. 12.100 / 59. 12.100  libavformat  59. 6.100 / 59. 6.100  libavdevice  59. 0.101 / 59. 0.101  libavfilter   8. 15.100 / 8. 15.100  libswscale   6. 1.100 / 6. 1.100  libswresample  4. 0.100 / 4. 0.100 Splitting the commandline. Reading option '-c:a' ... matched as option 'c' (codec name) with argument 'aac_at'. Reading option '-i' ... matched as input url with argument 'audio24b_he_aac.aac'. Reading option '-f' ... matched as option 'f' (force format) with argument 's16le'. Reading option '-acodec' ... matched as option 'acodec' (force audio codec ('copy' to copy stream)) with argument 'pcm_s16le'. Reading option 'output.pcm' ... matched as output url. Reading option '-v' ... matched as option 'v' (set logging level) with argument 'trace'. Finished splitting the commandline. Parsing a group of options: global . Applying option v (set logging level) with argument trace. Successfully parsed a group of options. Parsing a group of options: input url audio24b_he_aac.aac. Applying option c:a (codec name) with argument aac_at. Successfully parsed a group of options. Opening an input file: audio24b_he_aac.aac. [NULL @ 0x7f8cf4004d40] Opening 'audio24b_he_aac.aac' for reading [file @ 0x7f8cf4005180] Setting default whitelist 'file,crypto,data' Probing aac score:51 size:2048 [aac @ 0x7f8cf4004d40] Format aac probed with size=2048 and score=51 [aac @ 0x7f8cf4004d40] Before avformat_find_stream_info() pos: 0 bytes read:65696 seeks:4 nb_streams:1 [aac_at @ 0x7f8cf40057c0] AudioToolbox init error: 1718449215 [aac @ 0x7f8cf4004d40] All info found [aac @ 0x7f8cf4004d40] Estimating duration from bitrate, this may be inaccurate Following lines of code is failing. status = AudioConverterNew(&in_format, &out_format, &at->converter); if (status != 0) { av_log(avctx, AV_LOG_ERROR, "AudioToolbox init error: %i\n", (int)status); return AVERROR_UNKNOWN; } Is there any change with respect to these APIs in Monterey. I could not find any thing in the documentation or release notes.
Replies
1
Boosts
0
Views
2.1k
Activity
Mar ’23
Audio input bandwidth
My app samples the various inputs available on the iPhone and iPad and performs a frequency analysis. In addition to using the internal accelerometer and gyroscope I can also sample the microphone and USB input devices such as accelerometers through the audio input subsystem. The highest sample rate I use with the microphone and USB devices is the 48 KHz of the audio sampling subsystem. This provides a bandwidth of 24 kHz (Nyquist frequency) on the sampled signal. This has worked for many generations of iPhone and iPad until now. When I use my iPhone 14 Pro there is a sharp frequency cutoff at about 8 kHz. I see an artifact at the same frequency when I use the simulators. BUT when I use my 11" iPad Pro, or my current generation iPhone SE I do not see this effect and get good data out to 24 kHz. The iPad Pro does show some rolloff near 24 kHz which is noticeable but not a problem for most applications. The rolloff at 8 kHz is a serious problem for my customers who are testing equipment vibration and noise. I am wondering if this is related to the new microphone options "Standard", "Voice Isolation", and "Wide Spectrum". But if so, why only on the iPhone 14Pro and the simulators? I have searched the documentation but apparently it is not possible to programmatically change the microphone mode and the Apple documentation on how to use this new feature is lacking. I am using AVAudioSession and AVAudioRecorder methods to acquire the data through the audio capture hardware. This code has been working well for me for over 10 years so I do not think it is a code problem but it could be a configuration problem because of new hardware in the iPhone 14 although I have not found anything in the documentation. Examples from various devices and a simulator are shown below for microphone. Does anyone have an idea what may be causing this problem? iPhoneSE 3rd Gen iPad Gen 9 iPad Pro 11in iPhone 14Pro iPad 10th Generation Simulator
Replies
0
Boosts
0
Views
1.2k
Activity
Mar ’23
Starting recording from background for a VoIP application.
After searching for a few days, i have come to know that iOS doesn't allow recording in background. Through recording continues when it has started in foreground and goes to background. Came to know that, "This is a new a privacy protection restriction introduced in 12.4" When trying to start recording from background, we get “AVAudioSession.ErrorCode.cannotStartRecording” error. What do i need: our application needs to starts recording audio and transmit it while in background when user presses an external button i.e. PTT button of a BLE device. It seems there are several similar issue posted in this forum but neither could i find any plausible solution nor got any specific documentation from Apple. Requesting to help me out or at least please provide me a specific documentation stating "background recording is not possible". And if any workaround exists, please suggest. P.S. we are using **AVAudioSession.sharedInstance().setCategory(.playAndRecord, mode: .spokenAudio, options: [.mixWithOthers, .allowBluetooth, .allowBluetoothA2DP, .duckOthers]) **
Replies
0
Boosts
0
Views
1.2k
Activity
Feb ’23
core audio API library
I have a High Sierra system which I access via ssh and for which I program old-style from the command line in Objective-C and build via Makefiles. I have a very small program that employs the CoreAudio API and calls the AudioFileOpenURL and AudioFileClose functions. The program compiles ok but the linker is reporting that the symbols AudioFileOpenURL and AudioFileClose are undefined. I cannot find any dylib file among the libraries on my system that has those symbols. Can someone suggest where I might obtain the appropriate library? Here is the linker output that I am getting: gcc -o example1 example1.o -lobjc -lextension Undefined symbols for architecture x86_64: "_AudioFileClose", referenced from: _main in example1.o "_AudioFileGetProperty", referenced from: _main in example1.o "_AudioFileGetPropertyInfo", referenced from: _main in example1.o "_AudioFileOpenURL", referenced from: _main in example1.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [example1] Error 1
Replies
1
Boosts
0
Views
1k
Activity
Feb ’23
Write AAC files in a way that they are readable even in a crash
I'm building an audio recording app. For our users it's important that recordings never get lost - even if the app crashes, users would like to have the partial recording. We encode recordings in AAC or ALAC and store them in an m4a file using AVAudioFile. However, in case the app crashes, those m4a files are invalid - the MOOV atom is missing. Are there recording settings that change the m4a file so that it is always playable, even if the recording is interrupted half-way? I'm not at all an expert in audio codecs, but from what I understand, it is possible to write the MOOV atom at the beginning of the audio file instead of the end. This could solve this. But of course, I'd prefer an actual expert to tell me what a good solution is, and how to configure this in AVAudioFile.
Replies
3
Boosts
1
Views
2.0k
Activity
Feb ’23
Writing tapped buffers to disk asynchronously
I'd like to understand the most robust way to record audio to disk using AVAudioNodes installTap(onBus:bufferSize:format:block:) method. Currently, I'm dispatching out the buffers I receive in my AVAudioNodeTapBlock to a serial dispatch queue then writing to disk using some Audio Toolbox methods, but my concern is that if I hold on to the buffer provided in the AVAudioNodeTapBlock for too long (due to disk I/O for example), I'll end up getting issues. What I'm considering is creating my own larger pool of preallocated AVAudioPCMBuffers (a few seconds worth) and copying across the data from the buffer provided by the tap into one of the buffers from this larger pool in the AVAudioNodeTapBlock directly (no dispatch queue). Is there a simpler way of handling this, or does this sound like the best route?
Replies
1
Boosts
0
Views
971
Activity
Feb ’23
Can any body give me ios 9 simulator
I am trying to develop for iOS 9 the oldest version Xcode 12.5 supports but the lowest simulator you can download is iOS 11.4
Replies
1
Boosts
0
Views
1.3k
Activity
Jan ’23
Low level audio recording on macOS. Please Help!
I am struggling to see why the following low-level audio recording function - which is based on tn2091 - Device input using the HAL Output Audio Unit - (a great article, btw, although a bit dated, and it would be wonderful if it was updated to use Swift and non deprecated stuff at some point!) fails to work under macOS: func createMicUnit() -> AUAudioUnit { let compDesc = AudioComponentDescription( componentType: kAudioUnitType_Output, componentSubType: kAudioUnitSubType_HALOutput, // I am on macOS, os this is good componentManufacturer: kAudioUnitManufacturer_Apple, componentFlags: 0, componentFlagsMask: 0) return try! AUAudioUnit(componentDescription: compDesc, options: []) } func startMic() { // mic permision is already granted at this point, but let's check let status = AVCaptureDevice.authorizationStatus(for: AVMediaType.audio) precondition(status == .authorized) // yes, all good let unit = createMicUnit() unit.isInputEnabled = true unit.isOutputEnabled = false precondition(!unit.canPerformInput) // can't record yet, and know why? print(deviceName(unit.deviceID)) // "MacBook Pro Speakers" - this is why let micDeviceID = defaultInputDeviceID print(deviceName(micDeviceID)) // "MacBook Pro Microphone" - this is better try! unit.setDeviceID(micDeviceID) // let's switch device to mic precondition(unit.canPerformInput) // now we can record print("\(String(describing: unit.channelMap))") // channel map is "nil" by default unit.channelMap = [0] // not sure if this helps or not let sampleRate = deviceActualFrameRate(micDeviceID) print(sampleRate) // 48000.0 let format = AVAudioFormat( commonFormat: .pcmFormatFloat32, sampleRate: sampleRate, channels: 1, interleaved: false)! try! unit.outputBusses[1].setFormat(format) unit.inputHandler = { flags, timeStamp, frameCount, bus in fatalError("never gets here") // now the weird part - this is never called! } try! unit.allocateRenderResources() try! unit.startHardware() // let's go! print("mic should be working now... why it doesn't?") // from now on the (UI) app continues its normal run loop } All sanity checks pass with flying colors but unit's inputHandler is not being called. Any idea why? Thank you!
Replies
3
Boosts
0
Views
2.1k
Activity
Jan ’23
Getting audio from another application directly
I've seen applications such as Dante Via (Audinate) and Loopback (Rogue Amoeba) that can capture audio from an application directly. Which framework is used to achieve this? So far all I've seen is ways to tap in to audio devices with AUs.
Replies
1
Boosts
0
Views
1.5k
Activity
Dec ’22
API call to detect silent mode status
Does anyone know of an iOS API call that would return the status of silent mode?
Replies
0
Boosts
0
Views
1.1k
Activity
Oct ’22
MIDI file generated by using MusicSequenceFileCreate has Sysex MIDI message (iOS 16.0.2)
I am using the MusicSequenceFileCreate method to generate a MIDI file from a beat-based MusicSequence. In iOS 16.0.2 devices, the file that is created has a Sysex MIDI message added (not by me) to the file at time 0: f0 2a 11 67 40 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff ff ff ff 00 00 00 00 00 00 00 00 00 00 f7 Sysex messages are manufacturer dependent, a file with this Sysex message can't be read into apps like Nanostudio, Ableton, Zenbeats. It can be read by GarageBand. My app's deployment target is iOS 13.0. Has anybody else ran into this issue? Thanks
Replies
1
Boosts
0
Views
1.2k
Activity
Oct ’22