I want to get duraction of an AudioInputStream (in microseconds). How can I easily do that? I found how can I get duration of an audio file:, but can开发者_开发百科't do that, because of encapsulation. The only object I see is the instance of an AudioInputStream class.
getFrameLength() returns the stream length in frames, getFormat().getFrameRate() will give you the number of frames per second.
long durationInMillis = 1000 * getFrameLength() / getFormat().getFrameRate();
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论