Skip to content

Sender: how to know when all the data has been sent, and how to restart? #2012

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

You must be logged in to vote

The connections stays open as long as you return data: It is your choice if you want to return any pcm data or just silence data (an array with 0).

You can easily track if the full MemoryStream has been played by tracking the copied byte count: if the returned bytes are smaller then the requested bytes, you are at the end. Alternatively you can use the bool() operator or check the available() bytes from MemoryStream!

Please have a look at the class documentation!

Replies: 1 comment 2 replies

Comment options

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

@tastewar
Comment options

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