edith
Clone
https://git.tahinli.com/Tahinli/edith.git
0 watching0 forksRust18.3 MiBff99ad6Tahinli6 days ago1055 commits
| 1 | //! The per-clip gain where it has to be true: in the samples playback feeds the |
| 2 | //! device and in the samples an export writes. Both come off the same opener |
| 3 | //! with the same per-segment envelope ([`engine::Project::audio_fades_from`]), |
| 4 | //! so a clip at -6 dB must mix at half amplitude through that one door. |
| 5 | //! |
| 6 | //! The fixture is the 440 Hz / 880 Hz stereo tone in `test_av.mp4`; the assertion |
| 7 | //! is a ratio of RMS levels, never a level, so the fixture's own loudness drops |
| 8 | //! out. No picture is decoded. |
| 9 | |
| 10 | use PathBuf; |
| 11 | |
| 12 | use GainKey; |
| 13 | use ; |
| 14 | use FitPolicy; |
| 15 | use ; |
| 16 | |
| 17 | const RATE: u32 = 44_100; |
| 18 | const FPS: f64 = 30.0; |
| 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 | /// One video clip and one audio clip of `gain_db`, both from `test_av.mp4`. |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 | |
| 70 | |
| 71 | |
| 72 | |
| 73 | |
| 74 | |
| 75 | /// What the device is fed, drained to the end: the opener `PlaybackSession::seek` |
| 76 | /// and the export both call, with the same segments, eqs, speeds and fades. |
| 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 | /// Root mean square of `[from, to)` seconds of the interleaved stereo stream. |
| 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 | |
| 134 | |
| 135 | |
| 136 | |
| 137 | |
| 138 | /// The same tone through a volume envelope that falls from 0 dB at frame 0 to |
| 139 | /// -20 dB at frame 30 (1 s at 30 fps). At frame 15 (0.5 s) it is halfway, -10 dB; |
| 140 | /// at frame 45 (1.5 s) it is past the last point and holds at -20 dB. Each |
| 141 | /// level is measured as a ratio over a 40 ms window against the same window of |
| 142 | /// the unshaped clip, so the tone's own level drops out. |
| 143 | |
| 144 | |
| 145 | |
| 146 | |
| 147 | |
| 148 | |
| 149 | |
| 150 | |
| 151 | |
| 152 | |
| 153 | |
| 154 | |
| 155 | |
| 156 | |
| 157 | |
| 158 | |
| 159 | |
| 160 | |
| 161 | |
| 162 | |
| 163 | |
| 164 | |
| 165 | |
| 166 | |
| 167 |