Answer the question
In order to leave comments, you need to log in
How to make a progress bar for multiple tasks?
The layout is as follows: you need to compress the folder with audio files into another format (flac → mp3).
I would like to make a progress bar for this process, but there is a pitfall. Tasks are launched via Parallel.ForEach and report progress as follows: the Progress(object writer, long inputBytes, long outputBytes, bool finished) delegate is called at the specified frequency, which reports the number of bytes processed (inputBytes). In the case of one task, everything is simple, we divide the total file size by this inputBytes and multiply by 100. If several files are processed, it is easy to calculate their total size, but I don’t understand how to calculate the number of bytes processed. After all, inputBytes is always equal to the total number of bytes processed, not the number of bytes processed since the last occurrence of the event, and adding up results in wrong numbers. I hope I was able to explain clearly.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question