Open renezuidhof opened 8 months ago
The player was never designed with your use-case in mind. Can I consider this as a feature request?
Yes, it is indeed more like a feature request. I guess I was hoping it would magically work :)
I was also trying to call openPCM16AudioInMemory
again after changing the audio in memory. But I think the audioPlayer takes ownership over the memory so it gets freed after calling openPCM16AudioInMemory
again. So opening the same memory location would cause problems. Correct me if I'm wrong.
Could this work with using the AudioInMemory
class with a positive retain count? Is this something you would recommend?
@gaborszanto could you please clarify the internal behaviour of the player and caching points?
Does player cache internalBufferSizeSeconds of audio when playing? What happens when internalBufferSizeSeconds is 0? I noticed there is still caches audio in this case which I did not expect to be the case.
The value 0 enables "offline mode", where the player can not be used for real-time playback, but can process audio in an iteration
What do you mean by "can not be used for real-time playback, but can process audio in an iteration"?
Yes, the player caches approximately internalBufferSizeSeconds of audio when playing.
If that value is 0, it only caches the next chunk of audio. The size of the chunk depends on the audio format. Around 23 ms for the typical AAC file for example. That is typically too small for "live" playback, the risk of audio dropouts is too high for such small buffer size. Therefore the value 0 is only useful for "offline" playback.
Superpowered version: 2.6.2 (d67e895ca31e9d42fd41ba56e38ab970da243cab)
Describe the bug In my Android app I'm trying to use
audioPlayer.openPCM16AudioInMemory
to play audio from memory. After opening the audio in memory I want to edit the memory 'in place' while I expect the audioPlayer to always play whatever is in memory. This almost works, though it seems that the start point is cached in the audioPlayer and I can't see a way to clear this cached point.Playing around with
loopBetween
, making sure it's start point is outside of the cached memory, seems to work. But this is not something I can use as it is not a very reliable fix.Steps to Reproduce Basically I do this:
Let me know if you would like an edited example project.