-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Convert aac to m4a * Copy before conversion * Bump version * Delete unused file * Add doc
- Loading branch information
1 parent
8c01666
commit 967b22b
Showing
4 changed files
with
54 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import 'dart:io'; | ||
import 'package:path/path.dart' as p; | ||
|
||
import 'package:flutter_ffmpeg/flutter_ffmpeg.dart'; | ||
|
||
/// Wraps raw AAC with M4A container. | ||
/// Raw AAC doesn't support seeking, therefore it is unusable. | ||
Future<void> aacToM4a(File inputAAC, File outputM4A) async { | ||
assert(p.extension(inputAAC.path) == '.aac'); | ||
assert(p.extension(outputM4A.path) == '.m4a'); | ||
|
||
final command = '-i ${inputAAC.path} -codec: copy ${outputM4A.path}'; | ||
final code = await FlutterFFmpeg().execute(command); | ||
|
||
if (code != 0) { | ||
throw Exception('Could not convert AAC to M4A, error code: $code'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters