audiounit

AudioUnitRender got error kAudioUnitErr_CannotDoInCurrentContext (-10863)

青春壹個敷衍的年華 提交于 2019-12-11 07:34:06
问题 I want to play the recorded audio directly to speaker when headset is plugged in an iOS device. What I did is calling AudioUnitRender in AURenderCallback func so that the audio data is writed to AudioBuffer structure. It works well if the "IO buffer duration" is not set or set to 0.020seconds. If the "IO buffer duration" is set to a small value (0.005 etc.) by calling setPreferredIOBufferDuration , AudioUnitRender() will return an error: kAudioUnitErr_CannotDoInCurrentContext (-10863). Any

AudioUnit framework not found

柔情痞子 提交于 2019-12-11 06:04:30
问题 I am implementing an audio based application, in that I need to play both application audio and ipod auido. When I try to run my application I am getting an error like, ld: framework not found AudioUnit collect2: ld returned 1 exit status Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2 failed with exit code 1 my view controller code is as follows, .h file: #import <UIKit/UIKit.h> #import <MediaPlayer/MediaPlayer.h> #import <AudioToolbox/AudioToolbox.h>

Stop AudioUnit speech

别等时光非礼了梦想. 提交于 2019-12-11 05:02:12
问题 I'm implementing a speech synthesizer using Audio Unit, based on the Core Audio examples. Everything works as expected, except that StopSpeech and StopSpeechAt appear to do nothing. Here are the speak and stop methods: void Synthesizer::speak( const string &text ) { mIsSpeaking = true; mLastText = text; NSString *ns_text = [NSString stringWithCString:text.c_str() encoding:[NSString defaultCStringEncoding]]; CFStringRef cf_text = (__bridge CFStringRef)ns_text; CheckError( SpeakCFString(

AKAudioPlayer: No sound in speakers, only with headphones

谁都会走 提交于 2019-12-11 00:26:01
问题 Using AudioKit for sound management, I noticed an issue (bug?) with this very simple piece of code. import AudioKit class MainViewController: UIViewController { var audioFile: AKAudioFile? var audioPlayer: AKAudioPlayer? override func viewDidLoad() { super.viewDidLoad() } @IBAction func onPlayButtonClick(_ sender: Any) { do { audioFile = try AKAudioFile(forReading: Bundle.main.url(forResource: "3e", withExtension: "mp3")!) audioPlayer = try AKAudioPlayer(file: audioFile!) AudioKit.output =

iOS sine wave generation - audible clicking

喜夏-厌秋 提交于 2019-12-10 21:47:05
问题 I am in the process of creating a synthesiser for iOS. After playing around and attempting to learn core audio, I have encountered a problem that I cannot get my head around. My sine wave makes a clicking noise on regular intervals, which Im guessing is related to the phase. I have looked at several guides and books on the subject, and all suggest that I am doing it correctly. If anybody would be so kind to look at my code for me it would be greatly appreciated. static OSStatus renderInput

AudioBufferList contents in remoteIO audio unit playback callback

跟風遠走 提交于 2019-12-10 19:11:05
问题 I'd like to "intercept" audio data on its way to the iOS device's speaker. I believe this can be done using remoteIO audio units and callbacks. In the playbackCallback below does ioData actually contain any audio data? static OSStatus playbackCallback(void *inRefCon, AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber, UInt32 inNumberFrames, AudioBufferList *ioData) { ... } I'm confused because logging info about ioData seems to imply it contains

MIDI MusicDevice AudioUnit: Playing two notes of same pitch, stop one?

心不动则不痛 提交于 2019-12-10 17:38:40
问题 I am quite a novice when it comes to AudioUnits, so please forgive me if my question is very basic. I am using the MusicDevice AudioUnit to playback some notes. I am using MusicDeviceMIDIEvent to send the note-on and note-off messages. It works well. Sometimes more than one note should sound simultaneously, so I may send two note-on messages in a row. Sometimes these notes happen to have the same pitch. Then when I want to turn off one of the notes, I send a note-off event for this pitch. But

iOS - AudioUnitInitialize returns error code 561017449

馋奶兔 提交于 2019-12-10 14:13:30
问题 I have an app in the App Store which uses AudioUnit for recording audio. About once a week or so I am seeing that for some users in the wild the call to AudioUnitInitialize fails with the error code 561017449 which is also 0x21707269 or "irp!". What does this error code mean? I've been unable to find it documented. Also: ~$ macerror 561017449 Unknown error (561017449) at /usr/bin/macerror5.16 line 40, <DATA> line 1. There have been few instances of this issue, but so far there appears to be

Changing setPreferredIOBufferDuration at Runtime results in Core Audio Error -50

故事扮演 提交于 2019-12-10 12:07:19
问题 I am writing an Audio Unit (remote IO) based app that displays waveforms at a given buffer size. The app initially starts off with a preferred buffer size of 0.0001 which results in very small buffer frame sizes (i think its 14 frames). Than at runtime I have a UI element that allows switching buffer frame sizes via AVAudioSession 's method setPreferredIOBufferDuration:Error: . Here is the code where the first two cases change from a smaller to a larger sized buffer. 3-5 are not specified yet

Error from registration server when publishing audio unit

徘徊边缘 提交于 2019-12-10 09:31:58
问题 I'm trying to publish an AudioUnit generator on iOS. When I call - (void)publishOutputAudioUnit { AudioComponentDescription desc = { kAudioUnitType_RemoteGenerator, 'anap', 'cwcw', 0, 0 }; OSStatus status = AudioOutputUnitPublish(&desc, CFSTR("My app"), 1, m_au); if (status) { DLog(@"Couldn't publish audio unit"); } } I get the console message: ERROR: [0x39d1518c] 225: error -66748 from registration server with -66748 as the status. Google isn't helping me and neither are the docs. I'm