Replies: 1 comment
-
Regarding mimetype detection, we already have our own utility in the toolkit which should be preferred: https://github.com/readium/go-toolkit/blob/main/pkg/mediatype/mediatype.go If really needed, we might extend it using third-party dependencies like |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am starting a new discussion dedicated to audio formats for audiobooks. In previous community calls, we talked about the importance of making format conversion operations available in go-toolkit.
However, before we start coding, it is essential to create a matrix table of the formats we wish to support. This step is crucial because adding dependencies may increase the complexity unnecessarily.
We need to analyze format support in two steps:
Input conversion or recoding
Given an origin directory containing audio files in format
{source}
we may want to :{destination}
into a temporary directory before packaging themThe tool for the job is ffmpeg, ffmpeg-go is quite simple to use. It's just a wrapper around the ffmpeg binary, which should be available in the os running the cli. I wrote about it here:
https://github.com/readium/go-toolkit/discussions/71#discussioncomment-5239063
Manifest generation
When generating Readium Manifest we need to extract two properties of the audio file: the mimetype and the duration
mimetype
mimetype can be used for extracting the mimetype
duration
To identify the duration of multiple file formats, we have two choiches:
1. Use a decoder library
Until now, I've only supported mp3 and used and I've used go-mp3 in this way:
What other format should we support? We need to use a decoder library for each format and we should prefer a pure Go implementation. Here are some libraries we can use:
2. Use ffprobe
go-ffprobe can be used, but likewise go-ffmpeg needs the binary available in the OS.
Beta Was this translation helpful? Give feedback.
All reactions