Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How do I skip backwards on an AudioInputStream?

0
Posted

How do I skip backwards on an AudioInputStream?

0

In general, there is no clean way besides buffering the whole content of the AudioInputStream as done in the example Playing an audio file multiple times. There is one possibility: if the AudioInputStream is created from a FileInputStream, you can use AudioInputStream.skip() with a negative skipp amount. This works because the AudioInputStream implementation just passes the skip() call to its underlying stream and the FileInputStream implementation is able to handle random accesses. Note, however, that this relies on unspecified, implementation specific behaviour of the Sun JDK. Therefore, this approach should be used with care.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123