Search Unity

Incorrect AudioSource.time when streaming from vbr mp3

Discussion in 'Audio & Video' started by hkdtmer, Feb 12, 2016.

  1. hkdtmer

    hkdtmer

    Joined:
    Apr 2, 2014
    Posts:
    35
    My game allow users to load mp3 files by calling www.GetAudioClip, and seek to some specific positions by calling AudioSource.time during playback, but if the mp3 files are in vbr format and in streaming mode, the seek position will be different from the desired position by more than several seconds. This issue happens with AudioSource.timeSamples as well.

    Since the mp3 files are selected by users, I cannot prohibit users from using vbr files. Disabling streaming is also not an option because it will take a long time to decode long mp3 files. Are there any workarounds? Thanks!