fix(audio): add support for .opus files in audio duration calculation
This commit is contained in:
parent
bbdc57c18c
commit
602a92849c
@ -30,10 +30,11 @@ func GetAudioDuration(ctx context.Context, f io.ReadSeeker, ext string) (duratio
|
|||||||
duration, err = getFLACDuration(f)
|
duration, err = getFLACDuration(f)
|
||||||
case ".m4a", ".mp4":
|
case ".m4a", ".mp4":
|
||||||
duration, err = getM4ADuration(f)
|
duration, err = getM4ADuration(f)
|
||||||
case ".ogg", ".oga":
|
case ".ogg", ".oga", ".opus":
|
||||||
duration, err = getOGGDuration(f)
|
duration, err = getOGGDuration(f)
|
||||||
case ".opus":
|
if err != nil {
|
||||||
duration, err = getOpusDuration(f)
|
duration, err = getOpusDuration(f)
|
||||||
|
}
|
||||||
case ".aiff", ".aif", ".aifc":
|
case ".aiff", ".aif", ".aifc":
|
||||||
duration, err = getAIFFDuration(f)
|
duration, err = getAIFFDuration(f)
|
||||||
case ".webm":
|
case ".webm":
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user