muxtools.functions
do_audio
do_audio(fileIn: PathLike | list[PathLike], track: int = 0, trims: Trim | list[Trim] | None = None, timesource: TimeSourceT = Fraction(24000, 1001), timescale: TimeScaleT = TimeScale.MKV, num_frames: int = 0, extractor: Extractor | None = AutoExtractor(), trimmer: Trimmer | None = AutoTrimmer(), encoder: Encoder | None = AutoEncoder(), quiet: bool = True, output: PathLike | None = None) -> AudioFile
One-liner to handle the whole audio processing
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fileIn
|
PathLike | list[PathLike]
|
Input file |
required |
track
|
int
|
Audio track number |
0
|
trims
|
Trim | list[Trim] | None
|
Frame ranges to trim and/or combine, e.g. (24, -24) or [(24, 500), (700, 900)] |
None
|
timesource
|
TimeSourceT
|
The source of timestamps/timecodes. For details check the docstring on the type. |
Fraction(24000, 1001)
|
timescale
|
TimeScaleT
|
Unit of time (in seconds) in terms of which frame timestamps are represented. For details check the docstring on the type. |
MKV
|
num_frames
|
int
|
Total number of frames, used for negative numbers in trims |
0
|
extractor
|
Extractor | None
|
Tool used to extract the audio (always defaults to ffmpeg) |
AutoExtractor()
|
trimmer
|
Trimmer | None
|
Tool used to trim the audio AutoTrimmer means it will choose ffmpeg for lossy and Sox for lossless |
AutoTrimmer()
|
encoder
|
Encoder | None
|
Tool used to encode the audio AutoEncoder means it won't reencode lossy and choose opus otherwise. |
AutoEncoder()
|
quiet
|
bool
|
Whether the tool output should be visible |
True
|
output
|
PathLike | None
|
Custom output file or directory, extensions will be automatically added |
None
|
Returns:
| Type | Description |
|---|---|
AudioFile
|
AudioFile Object containing file path, delays and source |
Source code in
muxtools/functions.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | |