javax.sound.sampled.UnsupportedAudioFileException: could not get audio input stream from input file when loading wav file

后端 未结 1 1457
你的背包
你的背包 2020-12-01 22:24

i am using java 6 , and i am trying to load wav file, to get its duration as follows:

public static double getAudioFileDura         


        
相关标签:
1条回答
  • 2020-12-01 23:04

    ..any ideas how to fix this exception, ..

    Since WAV is a container format, it might include any number of encoding internally.

    ..wav files can be encoded with a variety of codecs to reduce the file size (for example the GSM or MP3 codecs).

    See the Java Sound info. page for details no how to add support for an extra encoding (using the SPI), and a lead on an MP3 SPI.

    ..or if there's another way to get file duration ?

    Not really. With compressed formats, bit rate is variable and there is no way to know for sure how long a track takes short of converting it to PCM or similar formats, in which the bit rate is constant & the track time is completely resolved.

    0 讨论(0)
提交回复
热议问题