core-audio

multi track mp3 playback for iOS application

蓝咒 提交于 2019-12-06 03:44:46
I am doing an application that involves playing back a song in a multi track format (drums, vocals, guitar, piano, etc...). I don't need to do any fancy audio processing to each track, all I need to be able to do is play, pause, and mute/unmute each track. I had been using multiple instances of AVAudioPlayer but when performing device testing, I noticed that the tracks are playing very slightly out of sync when they are first played. Furthermore, when I pause and play the tracks they continue to get more out of sync. After a bit of research I've realized that AVAudioplayer just has too much

iOS reverse audio through AVAssetWriter

烈酒焚心 提交于 2019-12-06 03:41:35
问题 I'm trying to reverse audio in iOS with AVAsset and AVAssetWriter. The following code is working, but the output file is shorter than input. For example, input file has 1:59 duration, but output 1:50 with the same audio content. - (void)reverse:(AVAsset *)asset { AVAssetReader* reader = [[AVAssetReader alloc] initWithAsset:asset error:nil]; AVAssetTrack* audioTrack = [[asset tracksWithMediaType:AVMediaTypeAudio] objectAtIndex:0]; NSMutableDictionary* audioReadSettings = [NSMutableDictionary

Which framework should I use to play an audio file (WAV, MP3, AIFF) in iOS with low latency?

假如想象 提交于 2019-12-06 02:51:39
iOS has various audio frameworks from the higher-level that lets you simply play a specified file, to the lower level that lets you get at the raw PCM data, and everything in between. For our app, we just need to play external files (WAV, AIFF, MP3) but we need to do so in response to pressing a button and we need that latency to be as small as possible. (It's for queueing in live productions.) Now the AVAudioPlayer and such work to play simple file assets (via their URL), but its latency in actually starting the sound is too great. With larger files of more than five minutes in length, the

iOS Audio Unit - Creating Stereo Sine Waves

不想你离开。 提交于 2019-12-06 02:42:17
问题 Over the weekend I hit a stumbling block learning how to program audio synthesis on iOS. I have been developing on iOS for several years, but I am just getting into the audio synthesis aspect. Right now, I am just programming demo apps to help me learn the concepts. I have currently been able to build and stack sine waves in a playback renderer for Audio Units without a problem. But, I want to understand what is going on in the renderer so I can render 2 separate sine waves in each Left and

How to find an audio file's length (in seconds)

余生颓废 提交于 2019-12-06 02:35:10
问题 (Objective C) Just using simple AudioServicesPlaySystemSoundID and its counterparts, but I can't find in the documentation if there is already a way to find the length of an audio file. I know there is AudioServicesGetPropertyInfo, but that seems to return a byte-buffer - do audio files embed their length in themselves and I can just extract it with this? Or is there perhaps a formula based on bit-rate * fileSize to convert to length-of-time? mIL3S www.milkdrinkingcow.com 回答1: According to a

Selecting input mic for Mac Audio Queue Services?

那年仲夏 提交于 2019-12-06 02:10:30
问题 I am currently using the Mac OS X Audio Queue Services API for audio recording and sound analysis. Works fine using the default mic input. If there is more than one microphone plugged into the Mac (USB, headset jack, etc.), is there a way to programmatically enumerate and select which mic is to be used for audio input within an application? (e.g. not have to send the user to the system preferences panel, which may affect a users other audio applications.) If so, which APIs should be used to

Cannot Control Volume of AVAudioPlayer via Hardware Buttons when AudioSessionActive is NO

巧了我就是萌 提交于 2019-12-06 00:45:40
I'm building a turn-by-turn navigation app that plays periodic, short clips of sound. Sound should play regardless of whether the screen is locked, should mix with other music playing, and should make other music duck when this audio plays. Apple discusses the turn-by-turn use case in detail in the "WWDC 2010 session 412 Audio Development for iPhone OS part 1" video at minute 29:20. The implementation works great, but there is one problem - when the app is running, pressing the hardware volume controls adjust the ringer volume, not the app volume. If you want to change the app volume, you must

Convert audio linear pcm to mp3 ( using LAME ) with the help of AudioQueueServices example in iOS

柔情痞子 提交于 2019-12-06 00:17:21
I am new in ios developement.I am encoding a LinearPCM to MP3 in iOS.I'm trying to encode the raw PCM data from microphone to MP3 using AudioToolbox framework and Lame.And although everything seems to run fine if i record .caf format . i am getting only noise and distortions present in the encoded stream. I'm not sure that I setup AudioQueue correctly and also that I process the encoded buffer in the right wat... My code to setup audio recording: sample project https://github.com/vecter/Audio-Queue-Services-Example - (void)setupAudioFormat:(AudioStreamBasicDescription*)format { format-

Eliminating current playing track sound in recording track

三世轮回 提交于 2019-12-05 22:50:39
I am looking to use RemoteI/O for audio recording and playing.I am very poor to understand core audio, because of that I followed Amazing Audio open source .So far I can able to Record and play with the same code, now I am trying to record through microphone and play though iphone speaker to avoid mixing of two audios while using simultaneous audio playing and recording. I have seen many posts in Stack Overflow that my question is duplicate, but I couldn't find exact answer for my problem. But I have hope to implement by seeing Apple document . Questions: How to implement simultaneous

Stopping and Quickly Replaying an AudioQueue

ⅰ亾dé卋堺 提交于 2019-12-05 21:06:37
I've got an audio queue that I've got playing, stopping, pausing correctly but I'm finding the AudioQueueStop() function to be taking a long time to execute. I'd like to immediately stop and then restart playing an audio queue and was wondering what the quickest way to do so would be. In my project I have multiple audio queues that I keep around to play specific sounds over and over. There is a situation where I must stop some of those sounds and then immediately play them and many more at once. It isn't so bad if there are only a couple of audio queues that I do this to but it starts taking a