Skip to content

Memorystream: fast looping - small delay at first play #471

Answered by pschatzmann
veitk asked this question in Q&A
Discussion options

You must be logged in to vote

Here are my 2 cents: Audio is only played smoothly if all the necessary audio data is provided in time. If you put everthing into one big fat loop there is a risk that this might not be the case.

If I would design a game, I would put the audio output into a separate task and manage the output via an audio queue. If you want to move into this direction, I suggest to have a look at this library which should be pretty easy to use.

Alternatively you can call copier.copyAll() which plays the whole "file" - but blocks the user from doing any actions, while the audio is processed.

Your logic with all the state variables is quite difficult to understand and to reason about. I would recommend to u…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@vkjambit
Comment options

Answer selected by pschatzmann
Comment options

You must be logged in to vote
2 replies
@vkjambit
Comment options

@vkjambit
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants