Java AudioInputStream how to support skip with negative number of bytes

后端 未结 2 1968
悲&欢浪女
悲&欢浪女 2021-01-24 00:47

I am trying to skip a negative number of bytes with AudioInputStream skip(long bytes) method .

The problem is trying to (let\'s say a small nu

2条回答
  •  南笙
    南笙 (楼主)
    2021-01-24 00:55

    Use your own buffer which holds a rolling window of history. I'd build a helper class that does this by allocating a List to manage history in blocks of for example 8192 bytes. Then you need some simple overflowing mechanism that throws out the oldest block, in combination with some pointer manipulation to keep track of where you actually are in the stream. Good luck!

提交回复
热议问题