The following problems seems to raise only on Firefox. (Chrome and Edge can play short audio file well)
This problems and solutions are confirmed on Firefox 52.0.2 (32-bit) on Windows 10 (x64)
When audio file is too short (eg. 10ms), Firefox seems to go to mute state, and cannot listen it.
To solve this problem, play silence audio loop (>= 1sec) in background.
When playing short audio, its quality may be aweful. Should append silence(>= 5ms) after audio file.
Firefox may be failed to decode MP3 file if it is too short (< 50ms).
Media resource ***** could not be decoded.
To solve this problem:
- Append silence until total length become 30ms - 50ms at least.
- Use CBR instead of VBR (eg. Should not use
lame -v
) - Convert to WAV file