core-audio

How to check current time and duration in AudioQueue

喜欢而已 提交于 2019-12-03 14:41:32
问题 How to get total time duration of music in audioQueue. I am using NSTimeInterval AQPlayer::getCurrentTime() { NSTimeInterval timeInterval = 0.0; AudioQueueTimelineRef timeLine; OSStatus status = AudioQueueCreateTimeline(mQueue, &timeLine); if(status == noErr) { AudioTimeStamp timeStamp; AudioQueueGetCurrentTime(mQueue, timeLine, &timeStamp, NULL); timeInterval = timeStamp.mSampleTime; } return timeInterval; } AudioQueueGetCurrentTime(mQueue, timeLine, &timeStamp, NULL); for getting current

Realtime audio processing without output

邮差的信 提交于 2019-12-03 14:21:20
I'm looking on this example http://teragonaudio.com/article/How-to-do-realtime-recording-with-effect-processing-on-iOS.html and i want to turn off my output. I try to change: kAudioSessionCategory_PlayAndRecord to kAudioSessionCategory_RecordAudio but this is not working. I also try to get rid off: if(AudioUnitSetProperty(*audioUnit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Output, 1, &streamDescription, sizeof(streamDescription)) != noErr) { return 1; } Becouse i want to get sound from microphone but not playing it. But not matter what i do when my sound get to renderCallback method

Is that possible to stream mms,ASX,RTSP stream on iPhone?

故事扮演 提交于 2019-12-03 13:52:01
I am developing one music streaming application. I can stream mp3 using a method described here . Does anybody know approach to stream other formats(ASX, RTSP or mms) using Core Audio or other framework. Thanks in advance. mms, ASX, and RTSP are historically somewhat proprietary protocols (by microsoft and real, in particular), so you may have trouble finding an official apple implementation. There's a LGPL implementation of the mms protocol here: https://launchpad.net/libmms Or you can get the documentation for the protocol from microsoft here: http://download.microsoft.com/download/9/5/E

Why might my AudioQueueOutputCallback not be called?

人走茶凉 提交于 2019-12-03 13:46:32
问题 I'm using the Audio Queue Services API to play audio streamed from a server over a TCP socket connection on an iPhone. I can play the buffers that were filled from the socket connection, I just cannot seem to make my AudioQueue call my AudioQueueOutputCallback function, and I'm out of ideas. High level design Data is passed to the player from the socket connection, and written immediately into circular buffers in memory. As AudioQueueBuffers become available, data is copied from the circular

How to get iPhone OS 3.1 muffled keyboard sound?

杀马特。学长 韩版系。学妹 提交于 2019-12-03 13:36:47
I have added the iPhone's Tock sound to my own custom keyboard like this: NSString *path = [[NSBundle bundleWithIdentifier:@"com.apple.UIKit"] pathForResource:@"Tock" ofType:@"aiff"]; SystemSoundID soundID; AudioServicesCreateSystemSoundID((CFURLRef)[NSURL fileURLWithPath:path], &soundID); AudioServicesPlaySystemSound(soundID); // we don't dispose of the sound to keep the sound in the cache for the next time //AudioServicesDisposeSystemSoundID(soundID); In iPhone OS 3.1, however, the keyboard Tock sound has been muffled, e.g. is much more silent than other sounds and than it was in 3.0. My

Audio Session “Ducking” Broken in iOS 4…?

风流意气都作罢 提交于 2019-12-03 13:08:19
I've an app which uses the MPAudioPlayerController to access the iPod music library, and an AVAudioPlayer to overlay audio on top of the music. I've used this documentation as a guide. Specifically: Finally, you can enhance a category to automatically lower the volume of other audio when your audio is playing. This could be used, for example, in an exercise application. Say the user is exercising along to their iPod when your application wants to overlay a verbal message—for instance, “You’ve been rowing for 10 minutes.” To ensure that the message from your application is intelligible, apply

AVPlayer not synchronized

China☆狼群 提交于 2019-12-03 13:00:28
问题 I'm really out of ideas so I'll have to ask you guys again... I'm building an iPhone application which uses three instances of AVPlayer. They all play at the same time and it's very important that they do so. I used to run this code: CMClockRef syncTime = CMClockGetHostTimeClock(); CMTime hostTime = CMClockGetTime(hostTime); [self.playerOne setRate:1.0f time:kCMTimeInvalid atHostTime:hostTime]; [self.playerTwo setRate:1.0f time:kCMTimeInvalid atHostTime:hostTime]; [self.playerThree setRate:1

AVAudioSession / Audio Session Services switching output

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-03 12:59:44
Okay, I have my AVAudioSession defined with the following (yes, mix of the c and obj-c calls) Also note that the app has background mode audio, because if recording it must continue to do so while the app is in the background: [(AVAudioSession *)[AVAudioSession sharedInstance] setDelegate: self]; // Allow the app sound to continue to play when the screen is locked. [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord error:nil]; //Turn off automatic gain on the microphone [[AVAudioSession sharedInstance] setMode:AVAudioSessionModeMeasurement error:nil]; //Turn on

How to record and play audio simultaneously in iOS using Swift?

十年热恋 提交于 2019-12-03 11:58:24
In Objective-C, recording and playing audio simultaneously is fairly simple. And there are tonnes of sample code on the internet. But I want to record and play audio simultaneously using Audio Unit/Core Audio in Swift. There are vary small amount of help and sample code on this using Swift. And i couldn't find any help which could show how to achieve this. I am struggling with the bellow code. let preferredIOBufferDuration = 0.005 let kInputBus = AudioUnitElement(1) let kOutputBus = AudioUnitElement(0) init() { // This is my Audio Unit settings code. var status: OSStatus do { try

How to use afconvert to convert from .caf to .mp3 format? [closed]

旧街凉风 提交于 2019-12-03 10:56:26
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I am using the afconvert command line utility to convert an audio file from .caf to .mp3 format. I have used afconvert : afconvert -f 'MPG3 ' -d '.mp3' -v input.caf output.mp3 But this gives me the following error: Input file: input.caf, 19008 frames Error: ExtAudioFileSetProperty ('cfmt') failed ('fmt?') I have