Easy AAC compressed audio conversion on iOS Easy AAC compressed audio conversion on iOS
  • Home
  • Posts
  • Home
  • Posts

Easy AAC compressed audio conversion on iOS

From the iPhone 3Gs up, it’s possible to encode compressed AAC audio from PCM audio data. That means great things for apps that deal with audio sharing and transmission, as the audio can be sent in compressed form, rather than sending huge PCM audio files over the network.

Apple’s produced some sample code (iPhoneExtAudioFileConvertTest), which demonstrates how it’s done, but their implementation isn’t particularly easy to use in existing projects, as it requires some wrapping to make it play nice.

For my upcoming looper app Loopy, I’ve put together a simple Objective-C class that performs the conversion of any audio file to an AAC-encoded m4a, asynchronously with a delegate, or converts any audio provided by a data source class (which provides for recording straight to AAC) and I thought I’d share it.

Read More

A simple, fast circular buffer implementation for audio processing

Circular buffers are pretty much what they sound like – arrays that wrap around. They’re fantastically useful as scratch space for audio processing, and generally passing audio around efficiently.

They’re designed for FIFO (first-in-first-out) use, like storing audio coming in the microphone for later playback or processing.

Consider a naive alternative: You copy the incoming audio into an NSData you allocate, and then pass that NSData off. This means you’re allocating memory each time, and deallocating the memory later once you’re done processing. That allocation incurs a penalty, which can be a show-stopper when part of an audio pipeline – The Core Audio documentation advises against any allocations when within a render callback, for example.

Alternatively, you can allocate space in advance, and write to that, but that has problems too: Either you have a synchronisation nightmare, or you spend lots of time moving bytes around so that the unprocessed audio is always at the beginning of the array.

A better solution is to use a circular buffer, where data goes in at the head, and is read from the tail. When you produce data at the head, the head moves up the array, and wraps around at the end. When you consume at the tail, the tail moves up too, so the tail chases the head around the circle.

Here’s a simple C implementation I recently put together for my app Loopy: TPCircularBuffer

Read More

Internet Timer keeps track of your timed Internet usage

Internet Timer iconI threw this utility app together last year, in order to keep track of our Internet usage on a time-limited account. This is a piece of software that lives quietly in your menubar, until an Internet connection is detected. Then, it will count how long you’ve been online, showing a timer in the menubar.

Features:

  • Detects your Internet connection automatically, or you can start and stop the timer manually.
  • Keep a log of your usage, including weekly, monthly, and all-time totals, and daily average, with the ability to reset these.
  • Time in configurable blocks of time, if your carrier charges in blocks (e.g., 15 minutes)
Read More

“Delicious Pixel artisan” – Totally time for a name change

Google Alerts just turned up this magnificent piece of mangling, from a content farm:

Melbourne, Australia – An iPhone application Delicious Pixel artisan “The Cartographer” was presented by Apple on the iPhone Application Shop for 9 consecutive weeks and was lately voted 3rd supreme in the supreme journey Application Application Ever contest….

Delicious Pixel focuses on Mac and iPhone applications with attractive and working individual interfaces – software that works like an extension of self, with the magnetism and elegance that make it a joy to use. A Pixel Delicious is the productive expression of a single creator and its obligation to uncover order in the planet – not to put things in boxes, though to shape the regions around things.

It’s nice to hear the folks at the supreme journey Application Application Ever contest like our working and magnetic interfaces.

Read More

Another, more complete, Loopy 2 demo, with singing and everything

Bear with me here – I’m a software developer, not a looper!

This is an early preview of Loopy 2 for iPhone (and soon iPad). Six tracks, simple touch controls. Tap a track to start recording, tap it again to stop. Tap in the middle to overdub, or elsewhere to mute the track. Drag one track onto another to merge instantly (not shown in this demo – another time!).

Inbuilt tempo settings (including live audio scaling, if you change the tempo mid-session), full stereo audio, volume and pan settings.

There’s plenty more, and I’ll demo them all in the weeks to come. Subscribe here, or over at loopyapp.com to stay tuned!

Read More

Loopy 2’s drum sequencer early preview

I’ve been busy over the past few days!

No percussion type icons yet, but the rest is basically there:

  • Full zoom/pan interface for use on an iPhone screen (although this was the simulator, operated with a mouse cursor).
  • Two velocity levels available for each cell (127 volume levels supported in the back end, but not in the interface yet)
  • 12 instruments
  • Custom sound set support, so you can built your own kit from your own sample set and import it into Loopy

This is unlikely to be in Loopy 2.0, but expect it around version 2.1.

Read More

A new Loopy 2 feature: Track twisting

A new feature of my upcoming looper app Loopy 2 that I just implemented in the last 15 minutes: Grab a track and twist it to offset it in the timeline, and hear the results, live. Great for adjusting minor timing problems, or mucking about with the sound.

Read More

Objective-C + Cocoa on the Command Line

Sometimes there’s just one tiny snippet of Cocoa code that you want to test — maybe to find out the output of NSDateFormatter for various cases, testing out some text replacement routine, or testing out some image drawing code.

It’s often too much trouble to create a new XCode project and set up the framework to do one simple test, which is why I put together this little shell script that lets you run Cocoa code from the command line:

$ runcocoa 'NSDateFormatter *formatter = [[[NSDateFormatter alloc] init] autorelease]; [formatter setDateFormat:@"d MMM, h:mm a"]; NSLog(@"%@", [formatter stringFromDate:[NSDate date]]);'

2011-02-23 20:02:10.313 runcocoa-output[28025:903] 23 Feb, 8:02 PM

You have full access to all Cocoa libraries, and in iOS mode, access to most iOS stuff too, straight from the command line.

Update: This is now available as a GitHub project

Read More

Hi! I'm Michael Tyson, and I run A Tasty Pixel from our home in the hills of Melbourne, Australia. I occasionally write on a variety of technology and software development topics. I've also spent 3.5-years travelling around Europe in a motorhome.

I make Loopy, the live-looper for iOS, Audiobus, the app-to-app audio platform, and Samplebot, a sampler and sequencer app for iOS.

Follow me on Twitter.

Posts pagination

« 1 … 13 14 15 … 36 »
© 2021 A Tasty Pixel.