AVAudioPlayer via Speakers

后端 未结 8 645
甜味超标
甜味超标 2021-02-06 13:16

I got the following code:

- (id)init {
    if (self = [super init]) {
        UInt32 sessionCategory = kAudioSessionCategory_MediaPlayback;
        AudioSessionS         


        
8条回答
  •  闹比i
    闹比i (楼主)
    2021-02-06 13:54

    You're code for playing the sound looks correct, and there's no reason you should have to use AudioToolbox. One thing you might want to make sure of is that you are using supported audio formats. (I personally have had success with MP3 and WAV)

    Also, could you share with us your code as to how you get the url to your sound file?

提交回复
热议问题