Realtime sampling of incoming audio. For bat calls, this would be the output from a time expanding bat detector.

Loading pre-recorded audio from a file.

Initially we will be using method (2). As mentioned before, it’s much easier to load samples from a file, rather than make a bat squeak into a microphone on demand!

So we need to read from an audio file on disk to a list of samples held in an array in our program. Apple provide tools to do this, in the form of an API called Core Audio. As with the Accelerate/vDSP framework, this is quite a low level API in C, and it has a reputation for being tricky to use. Fortunately for us, we only need to use a small part of it that deals with reading and converting audio formats.

The Jisc-funded BatMobile project has now ended but the wider Nature Locator programme of mobile app development continues. Please contact project manager Dave Kilbey if you are interested in developing the BatMobile ideas further.