AudioQueue Trimming and Buffer Size

Despite the fact that the application works as expected, I get a message in the console that I would like to understand in more detail.

The setting is as follows. AVAudioPlayer is created and the .m4a file is downloaded (03:22 in length and 618 KB). The file has a bit of 23 kbps. I understand that the data transfer rate is very low, but this is acceptable for the application.

Whenever I set the currentTime property of the audio player, I get the following message registered on the console.

AudioQueue: cropping request 2112 + 0 = 2112 frames from a buffer containing 1024 frames

The result of setting the currentTime property will be as expected, but I'm wondering what exactly this message means, and what I can do to prevent it from appearing.

+6
source share
1 answer

Worked for me: stop the player before setting its current Time property. Then set currentTime, prepare ToPlay and play.

[avAudioPlayer stop]; [avAudioPlayer setCurrentTime:newCurrentTime]; [avAudioPlayer prepareToPlay]; [avAudioPlayer play]; 

source: http://eureka.ykyuen.info/2010/06/10/iphone-add-an-uislider-for-avaudioplayer/

+5
source

Source: https://habr.com/ru/post/915550/


All Articles