4

I have a problem. I want use some functionality which work with sound in my app.

I found example SpeakHere and include the main part functionality of this app in my app. But I have 3 errors:

No matching function for call to 'AudioSessionInitialize'

enter image description here

How can I fix this bugs?

I added to project frameworks: coreAudio, AudioToolbox
I use ARC.

andr
  • 15,970
  • 10
  • 45
  • 59
Vit
  • 936
  • 1
  • 10
  • 20

4 Answers4

11

This is a bridging problem as per AudioServices.h not found in objective-C iOS project that includes AudioToolbox framework

Basically you need to use (__bridge void*)self in those 3 places.

Community
  • 1
  • 1
Ashley
  • 126
  • 3
6
AudioSessionInitialize(NULL, NULL, interruptionListener, (__bridge void*)self);

because you are using ARC, so you need to transfer (void *) into (__bridge void*)

Kirk
  • 16,182
  • 20
  • 80
  • 112
likid1412
  • 963
  • 8
  • 15
0

You need to make sure you have the following import in your code:

#import <AudioToolbox/AudioToolbox.h>
Circumflex
  • 710
  • 4
  • 11
0

Add the AudiToolbox framework to the build phases, then

#import <AudioToolbox/AudioToolbox.h>

Build Phases

Matt Williamson
  • 39,165
  • 10
  • 64
  • 72