Repository navigation
Description
The ffmpeg package provides media utilites for doing codec conversions and getting the duration of an audio file.
The downside is that ffmpeg bloats the Sounds package to the point there is a LITE and a FULL flavor of Sounds and even the LITE version is fat.
An issue has already been raised to move all codec conversions into separate packages in which case ffmpeg would also be moved into a separate package.
The other use of ffmpeg is to obtain a duration of a audio file, however it appears that android at least provides support for obtaining the duration of a audio file without using a third party package.
This issue needs to completely remove FFMpeg from the Sounds and re-implement the dart library CodecHelper.getDuration using native ios and android methods as described by the above two links.
The dart library ffmpeg_util.dart currently implements the duration method which calls into the java/objective-c code using the plugin method: getMediaInformation.
The getMediaInformation method should be replaced with a duration method that returns (via a callback) the audio files duration as a long in milliseconds.
The 'getDuration' method will receive a three arguments:
slotNo:
path:
uuid:
Which will be a path to the audio file on the local file system.
The callback method name should be 'duration' and pass two values in a map:
slotNo - the plugin slot number passed by the dart code when calling getDuration
arg: - a json map contain the duration
The json map should contain a single key value pair:
{
"uuid" : ,
"milliseconds":
}
Activity
bsutton commentedon Jun 28, 2020
done.