开发者

System Sound Lock

I开发者_如何学Python am developing an iPhone app that translates voice to text. The component for the Transcribe is third-party. Until now everything worked just fine. Today I tried playing a sound (.wav file) after making the Transcription and noticed that I cannot play anything (by AVAudio or system sound). After debugging I found out that this is happening after initing the third-party component; so I think that the component is not releasing something that belongs to the system audio.

My question is : Is there a way to force the iPhone play the sound that I want?


Have you tried setting AVAudioSession category?

NSError *err = nil;
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:&err];

Maybe other category will work, for example AVAudioSessionCategoryPlayAndRecord

The best way IMO is to save AVAudioSession state (its category, for example) before using your third-party component and restore state afterwards.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜