AudioStreamer电话打进时崩溃

最近的项目中音频在线播放功能使用的是AudioStreamer,测试电话打进时的打断是遇到了个问题,总是在下面的位置崩溃:
#if TARGET_OS_IPHONE			
//
// ASAudioSessionInterruptionListener
//
// Invoked if the audio session is interrupted (like when the phone rings)
//
static void ASAudioSessionInterruptionListener(void *inClientData, UInt32 inInterruptionState)
{
	AudioStreamer* streamer = (AudioStreamer *)inClientData;
	[streamer handleInterruptionChangeToState:inInterruptionState];
}
#endif
我只是设置了个断点进行调试,发现streamer变量的地址不正确,也没打开内存栈来仔细调试查看,但肯定是这个变量的问题。 索性把这两行代码注释掉。自己实现AVAudioSessionDelegate的方法。 当有电话打进的时候,这里可以处理将正在播放的音乐停止,然后打完电话后再重新播放
- (void)beginInterruption

{

//停止播放的事件

}



- (void)endInterruption

{

//继续播放的事件

}

转载于:https://www.cnblogs.com/wanyakun/archive/2013/03/21/3403336.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值