1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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
134
135
136
137
138
139
140
141
142
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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
//! thresholds the analyzer measures and reads with, all data the caller passes
use std::fmt;
/// a cutoff at or above this fraction of the band's top counts as reaching it, when a window is
/// measured and when it is read
const FULL_BAND: f64 = 0.9;
/// Thresholds each window is measured with.
///
/// Changing one means measuring the audio again.
///
/// No value is checked against a range. One outside what its field describes, or not a number,
/// gives measures that mean nothing, and no panic.
#[derive(Clone, Debug, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(
feature = "serde",
serde(default, deny_unknown_fields, rename_all = "camelCase")
)]
pub struct MeasureThresholds {
/// Level in dBFS under which a window is near-silent.
///
/// A near-silent window has no cutoff.
pub silence_dbfs: f64,
/// Range in dB under the loudest band that the cutoff lies in.
///
/// The cutoff is the highest band within this range.
pub cutoff_range_db: f64,
/// Margin in dB of the cutoff line over quantization noise.
///
/// The line never sits closer to the noise of the samples' bit depth, so a quiet passage's
/// quantization noise does not read as content.
pub floor_margin_db: f64,
/// Gap in Hz to the bands compared across a frequency.
pub shelf_gap_hz: f64,
/// Width in Hz of the bands compared across a frequency.
pub shelf_span_hz: f64,
/// Fraction of the top a cutoff needs for an inner step search.
///
/// A window is searched for a step inside its band when its cutoff is at or above this
/// fraction of the band's top.
pub full_band: f64,
/// Lowest frequency in Hz an inner step is looked for at.
pub inner_shelf_from_hz: f64,
/// Start in Hz of the band gaps are counted in.
///
/// It is where MP3's top scale-factor band sits.
pub holes_from_hz: f64,
/// Top in Hz of the band gaps are counted in.
pub holes_to_hz: f64,
/// Depth in dB under its neighbors at which a bin is a gap.
pub hole_depth_db: f64,
/// Whether MP3 and AAC are scanned for at the other rate too.
///
/// It applies to a file at 44.1 or 48 kHz. The scan at the other of the two rates finds a
/// decode that was converted between them ([`OtherRate`](crate::grid::OtherRate)). It takes
/// about as long as the scan for MP3 and AAC at the file's own rate.
pub scan_other_rate: bool,
}
impl Default for MeasureThresholds {
fn default() -> Self {
Self {
silence_dbfs: -70.0,
cutoff_range_db: 60.0,
floor_margin_db: 10.0,
shelf_gap_hz: 100.0,
shelf_span_hz: 500.0,
full_band: FULL_BAND,
inner_shelf_from_hz: 10_000.0,
holes_from_hz: 16_000.0,
holes_to_hz: 20_000.0,
hole_depth_db: 20.0,
scan_other_rate: true,
}
}
}
/// Thresholds the measures are read with.
///
/// A reading is quick, so these can be swept over audio measured once.
///
/// No value is checked against a range. One outside what its field describes, or not a number,
/// gives a reading that means nothing, and no panic.
#[derive(Clone, Debug, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(
feature = "serde",
serde(default, deny_unknown_fields, rename_all = "camelCase")
)]
pub struct ReadingThresholds {
/// Least drop in dB across the cutoff for an encoder's low-pass.
///
/// A smaller drop is a natural roll-off.
pub sharp_shelf_db: f64,
/// Fraction of the top from which a cutoff counts as full band.
///
/// A cutoff at or above this fraction of the band's top counts as reaching it. Set below
/// [`MeasureThresholds::full_band`], it counts as full some windows that measuring never
/// searched for inner steps.
pub full_band: f64,
/// Fraction of the top under which a gentle roll-off is not judged.
///
/// Content that rolls off gently below it is band-limited by nature, and the reading says it
/// cannot tell.
pub natural_limit: f64,
/// Least inner step in dB that reads as a band-limited layer.
///
/// A step of at least this size inside a full band is a band-limited layer under it.
pub inner_shelf_db: f64,
/// Least step in dB at a top-bitrate cutoff that casts doubt.
///
/// Such a step under a band that reaches the top reads as something the analyzer cannot tell,
/// which costs an honest file nothing. Honest spectra step by a decibel or two there.
pub high_step_db: f64,
/// Height in dB over the cutoff line that makes a band content.
///
/// The band above a step is content only at this height or more. Nearer the line it is the
/// recording's noise floor, hiss or dither.
pub clear_db: f64,
/// Fewest non-silent windows a reading needs.
pub min_windows: usize,
/// Fewest seconds of non-silent audio a reading needs.
pub min_seconds: f64,
/// Seconds past `min_seconds` with little to go on.
///
/// Within this many seconds over `min_seconds` a reading says it has little to go on. There
/// each second moves the shares its rules compare by about 2.5 percent, so a few odd
/// seconds can tip it.
pub few_seconds_over: f64,
/// Share of windows at the top of the band for consistent content.
///
/// At least this share of windows must reach the top for the content to be consistent with
/// its claim.
pub consistent_share: f64,
/// Share of windows that stop at one encoder cutoff for a transcode.
pub transcode_share: f64,
/// Distance in Hz at which a cutoff still shares the common one.
pub cluster_hz: f64,
/// Percentile of a lossy file's cutoffs read as its encoder's ceiling.
pub ceiling: f64,
/// Share of windows each of two sources has for mixed sources.
pub mixed_share: f64,
/// Band tops in Hz of the sample rates audio is commonly made at.
///
/// Content that stops with a cliff at one, in a file whose band reaches past it, was made at
/// that rate.
pub lower_rate_edges: Vec<f64>,
/// Band edges of rates some old equipment recorded at.
///
/// They are left out of `lower_rate_edges` because they sit on encoder cutoffs (18.9 kHz
/// beside 192 kbps MP3's). A cliff at one reads as that encoder, with a limitation naming the
/// rate.
pub other_rate_edges: Vec<RateEdge>,
/// Correlation above which two channels hold the same audio.
///
/// It applies together with a side channel at or below `mono_side_db`.
pub mono_correlation: f64,
/// Side-to-mid level in dB at or below which channels match.
///
/// At or below this level of the side channel relative to the mid channel, the two channels
/// hold the same audio.
pub mono_side_db: f64,
/// Highest confidence a reading has, from 0 to 1.
///
/// A reading by a grid has this confidence itself, so a cap that is negative or not a number
/// is the confidence of such a reading.
pub confidence_cap: f64,
/// Median window level in dBFS under which a file is quiet.
///
/// A quiet file makes a reading less sure.
pub quiet_dbfs: f64,
/// Bitrate in kbit/s from which a cutoff may be a filter.
///
/// Profiles at this bitrate and above cut where some recordings are filtered when they are
/// made, so a sharp shelf there reads as something the analyzer cannot tell, never as a
/// transcode.
pub high_bitrate_kbps: u32,
/// Cutoffs of common lossy encoder settings, lowest first.
pub profiles: Vec<EncoderProfile>,
/// Robust z over which the AAC scan finds a frame grid.
///
/// It is compared with [`CodecScan::z`](crate::grid::CodecScan::z). A lower value finds more
/// grids in decodes that hide them, such as clipped ones, and finds them in more lossless
/// files whose counts happen to dip at one offset.
pub aac_grid_z: f64,
/// Fewest segments that put their lowest count at the file's offset, for an AAC grid.
///
/// It is compared with [`CodecScan::segments_agreeing`]. A decode carries one grid from start
/// to end, so every segment finds it at the same offset. The segments of a lossless file can
/// agree on an offset too, so agreement alone is no grid: it only narrows what the z
/// threshold finds. A file that holds a lossy section only in part falls short, and so does
/// a Vorbis decode, whose grid the AAC scan finds at an offset that moves between segments.
///
/// [`CodecScan::segments_agreeing`]: crate::grid::CodecScan::segments_agreeing
pub aac_grid_segments_agreeing: usize,
/// Robust z over which the MP3 scan finds a frame grid.
///
/// It is compared with [`CodecScan::z`](crate::grid::CodecScan::z), as `aac_grid_z` is.
pub mp3_grid_z: f64,
/// Fewest segments that put their lowest count at the file's offset, for an MP3 grid.
///
/// It is compared with [`CodecScan::segments_agreeing`], as `aac_grid_segments_agreeing` is.
///
/// [`CodecScan::segments_agreeing`]: crate::grid::CodecScan::segments_agreeing
pub mp3_grid_segments_agreeing: usize,
/// Robust z over which the AAC scan at the other rate finds a frame grid.
///
/// It is compared with the z of [`OtherRate::aac`](crate::grid::OtherRate::aac) and of
/// [`OtherRate::aac_sine`](crate::grid::OtherRate::aac_sine), with the agreement
/// `aac_grid_segments_agreeing` asks for. Decodes of other codecs dip further at the other
/// rate than lossless files do at their own, so it stands over `aac_grid_z`.
pub other_rate_aac_z: f64,
/// Fewest scalefactor bands on whole steps in a segment, for an MP3 grid.
///
/// It is compared with each of
/// [`Mp3Steps::segment_whole`](crate::grid::Mp3Steps::segment_whole), the bands on whole
/// steps of MP3's quantizer, where no count stands out enough for a grid: as many segments
/// as `mp3_grid_segments_agreeing` must reach it, one at least. A band of lossless audio
/// lands on a whole step by chance a few times in a file.
pub mp3_whole_steps: usize,
/// Fewest scalefactor bands on whole steps in a segment, for an AAC grid.
///
/// It is compared with each of
/// [`AacSteps::segment_whole`](crate::grid::AacSteps::segment_whole), the bands on whole
/// steps of AAC's quantizer, under each window: as many segments as
/// `aac_grid_segments_agreeing` must reach it, one at least. The steps show a grid no count
/// stands out enough for, and name the window of one a count found.
pub aac_whole_steps: usize,
/// Fewest frames on Opus's lattice at one offset, for an Opus grid.
///
/// It is compared with [`OpusScan::frames`](crate::grid::OpusScan::frames), the count over
/// the four segments. A frame of lossless audio lands on the lattice by chance at some
/// offset in some files, never at the same offset often.
pub opus_grid_frames: usize,
/// Fewest frames on Opus's lattice in the windows, for an Opus grid.
///
/// It is compared with [`OpusScan::uncut_frames`](crate::grid::OpusScan::uncut_frames), the
/// count on the one grid a decode has when nothing was cut from its start.
pub opus_uncut_frames: usize,
/// Fewest frames on Opus's lattice at another level, at one offset.
///
/// It is compared with [`OpusShifted::frames`](crate::grid::OpusShifted::frames), the count
/// over the four segments, where neither count at the decoder's own level makes an Opus
/// grid. The search for the level gives chance more frames than `opus_grid_frames` meets.
pub opus_shifted_frames: usize,
/// Fewest frames on Opus's lattice at another level in the windows.
///
/// It is compared with
/// [`OpusShifted::uncut_frames`](crate::grid::OpusShifted::uncut_frames), as
/// `opus_shifted_frames` is with its count.
pub opus_shifted_uncut_frames: usize,
/// Fewest frames under 20 ms on Opus's lattice at one offset.
///
/// It is compared with [`OpusShort::frames`](crate::grid::OpusShort::frames) of each
/// length, the count over the four segments, where no count of 20 ms frames makes an Opus
/// grid.
pub opus_short_frames: usize,
/// Fewest frames under 20 ms on Opus's lattice in the windows.
///
/// It is compared with [`OpusShort::uncut_frames`](crate::grid::OpusShort::uncut_frames)
/// of each length, as `opus_short_frames` is with its count.
pub opus_short_uncut_frames: usize,
/// Weights that read an MP3 grid at offset 1 as Fraunhofer's encoder.
pub fraunhofer_steps: FraunhoferSteps,
/// Fewest different pairs of steps among Opus's hybrid frames.
///
/// It is compared with [`OpusHybrid::steps`](crate::grid::OpusHybrid::steps) and with
/// [`OpusHybrid::uncut_steps`](crate::grid::OpusHybrid::uncut_steps), where no other count
/// makes an Opus grid. The frames counted must meet `opus_hybrid_share` too.
pub opus_hybrid_steps: usize,
/// Fewest hybrid frames as a share of the frames tested, from 0 to 1.
///
/// The two bands a hybrid frame is tested on land on the lattice by chance in a few frames
/// of a hundred, which in a long file is more pairs of steps than `opus_hybrid_steps`.
pub opus_hybrid_share: f64,
}
/// Weights that read the steps of an MP3 decode as Fraunhofer's encoder.
///
/// Encoders that state no delay all leave their grid at offset 1. They differ in how they
/// move a band's quantizer step from the band under it, which
/// [`Mp3Neighbours`](crate::grid::Mp3Neighbours) counts. Each weight multiplies one share of
/// those counts, and a decode whose sum is over `over` reads as Fraunhofer's.
///
/// The weights were fitted on decodes of the codec Windows ships against Shine, BladeEnc,
/// GOGO, Apple, Helix and LAME. Another version of Fraunhofer's encoder may fall under the
/// threshold.
#[derive(Clone, Debug, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(
feature = "serde",
serde(default, deny_unknown_fields, rename_all = "camelCase")
)]
pub struct FraunhoferSteps {
/// Fewest pairs of neighbouring bands, over the three regions.
pub min_pairs: usize,
/// Fewest pairs in each region.
pub min_region_pairs: usize,
/// Weight of the pairs whose higher band is two quarter powers finer.
///
/// The pairs count as a share of all.
pub two_finer: f64,
/// Weight of the pairs whose higher band is two quarter powers coarser.
///
/// The pairs count as a share of all.
pub two_coarser: f64,
/// Weight of each region's pairs with one step.
///
/// The pairs count as a share of the region's.
pub same: [f64; 3],
/// Weight of each region's pairs whose higher band is finer.
///
/// The pairs count as a share of the region's.
pub finer: [f64; 3],
/// Weight of the mean logarithm of the largest value in bands 0 to 5.
pub low_log: f64,
/// Weight of the mean logarithm of the largest value in bands 12 up.
pub high_log: f64,
/// Weight of the lowest region's pairs, as a share of all.
pub low_share: f64,
/// Weight of the highest region's pairs, as a share of all.
pub high_share: f64,
/// Sum over which the steps read as Fraunhofer's.
///
/// A higher value names fewer of its decodes and fewer of another encoder's.
pub over: f64,
}
impl Default for FraunhoferSteps {
fn default() -> Self {
// fitted in the tuning on 445 decodes of Fraunhofer's codec against 2,989 of other
// encoders. each master left out in turn, the threshold names 361 of the 445, none of
// 468 decodes of the other encoders at offset 1 and 3 of 2,521 of LAME and Helix
Self {
min_pairs: 200,
min_region_pairs: 30,
two_finer: 18.913,
two_coarser: -46.687,
same: [-10.995, 14.846, 24.374],
finer: [-2.863, 37.678, 15.258],
low_log: -2.315,
high_log: 1.054,
low_share: -1.271,
high_share: -6.886,
over: 26.001,
}
}
}
/// Band top of a rate some old equipment recorded at.
#[derive(Clone, Debug, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(deny_unknown_fields))]
pub struct RateEdge {
/// Half the rate, in Hz.
pub hz: f64,
/// Rate and who used it, as a limitation names it.
pub rate: String,
}
/// Lossy encoder setting known by where it cuts off.
#[derive(Clone, Debug, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(deny_unknown_fields))]
pub struct EncoderProfile {
/// Cutoff at 44.1 and 48 kHz, in Hz.
pub hz: f64,
/// Codec that cuts here, spelled as a grid's codec is written.
pub codec: String,
/// Setting of that codec that cuts here, in words.
pub setting: String,
/// Another codec that cuts here too.
#[cfg_attr(feature = "serde", serde(default))]
pub also: Option<String>,
/// Highest nominal bitrate cut here, in kbit/s.
pub kbps: u32,
}
impl EncoderProfile {
fn mp3(hz: f64, setting: &str, kbps: u32) -> Self {
Self {
hz,
codec: "MP3".to_string(),
setting: setting.to_string(),
also: None,
kbps,
}
}
}
/// Writes the profile's name: the codec, its setting, then the other codec after "or".
impl fmt::Display for EncoderProfile {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{} {}", self.codec, self.setting)?;
match &self.also {
Some(also) => write!(f, " or {also}"),
None => Ok(()),
}
}
}
impl Default for ReadingThresholds {
fn default() -> Self {
Self {
sharp_shelf_db: 30.0,
full_band: FULL_BAND,
natural_limit: 0.75,
inner_shelf_db: 20.0,
high_step_db: 10.0,
clear_db: 10.0,
min_windows: 20,
min_seconds: 30.0,
few_seconds_over: 10.0,
consistent_share: 0.9,
transcode_share: 0.85,
cluster_hz: 500.0,
ceiling: 0.9,
mixed_share: 0.15,
// 22.05, 32, 44.1 and 48 kHz
lower_rate_edges: vec![11_025.0, 16_000.0, 22_050.0, 24_000.0],
other_rate_edges: [
(18_900.0, "37.8 kHz (PlayStation and CD-i audio)"),
(15_000.0, "30 kHz (some older samplers)"),
(13_020.0, "26.04 kHz (some older samplers)"),
]
.map(|(hz, rate)| RateEdge {
hz,
rate: rate.to_string(),
})
.to_vec(),
mono_correlation: 0.9999,
mono_side_db: -90.0,
confidence_cap: 0.98,
quiet_dbfs: -40.0,
high_bitrate_kbps: 320,
// LAME's defaults are the commonest; other MP3 encoders and AAC cut a little lower at the
// same bitrate
profiles: vec![
EncoderProfile::mp3(11_000.0, "~64 kbps", 64),
EncoderProfile::mp3(13_500.0, "~80 kbps", 80),
EncoderProfile::mp3(15_100.0, "~96 kbps", 96),
EncoderProfile::mp3(16_000.0, "~128 kbps", 128),
EncoderProfile::mp3(17_000.0, "~128 kbps", 128),
EncoderProfile::mp3(17_500.0, "~160 kbps", 160),
EncoderProfile::mp3(18_600.0, "~192 kbps", 192),
EncoderProfile::mp3(19_400.0, "~224 kbps", 224),
// LAME 3.100 cuts 224 kbps here too, so the name says both
EncoderProfile::mp3(19_530.0, "~224-256 kbps", 256),
EncoderProfile {
also: Some("AAC".to_string()),
..EncoderProfile::mp3(20_000.0, "~320 kbps", 320)
},
EncoderProfile::mp3(20_500.0, "~320 kbps", 320),
],
// the tuning's lossless files reach z 8.24 for AAC, and 11.57 for MP3 apart from one with
// an MP3 section in one segment, which the agreement keeps out
aac_grid_z: 9.0,
aac_grid_segments_agreeing: 0,
mp3_grid_z: 12.0,
mp3_grid_segments_agreeing: 3,
// the tuning's files with no AAC behind a conversion reach 9.63 there, and its converted
// AAC decodes that show a grid start at 16.7
other_rate_aac_z: 13.0,
// three stretches of the tuning's files that were never MP3 reach seven whole steps
mp3_whole_steps: 20,
// a stretch of the tuning's Vorbis decodes reaches 138 whole steps under one window, and of
// its files that were never AAC 11
aac_whole_steps: 200,
// the tuning's files that were never Opus reach one frame in the stretches and one in
// the windows
opus_grid_frames: 3,
opus_uncut_frames: 3,
// with a level searched for they reach four frames in the stretches and one in the
// windows, apart from one master that carries such frames on an uncut decode's grid
opus_shifted_frames: 6,
opus_shifted_uncut_frames: 4,
// of frames under 20 ms they reach one in the stretches and one in the windows
opus_short_frames: 3,
opus_short_uncut_frames: 3,
fraunhofer_steps: FraunhoferSteps::default(),
// the pilot files that were never Opus reach nine pairs of steps at this share, and a
// share of 0.04 with this many pairs
opus_hybrid_steps: 30,
opus_hybrid_share: 0.1,
}
}
}
impl ReadingThresholds {
/// fewer seconds of non-silent audio than this give a reading little to go on, which it says
pub(crate) fn few_seconds(&self) -> f64 {
self.min_seconds + self.few_seconds_over
}
/// the profile whose cutoff is nearest `hz`, when one is within `cluster_hz`
pub(crate) fn profile_at(&self, hz: f64) -> Option<&EncoderProfile> {
self
.profiles
.iter()
.filter(|p| (p.hz - hz).abs() <= self.cluster_hz)
.min_by(|a, b| (a.hz - hz).abs().total_cmp(&(b.hz - hz).abs()))
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn thresholds_read_from_json_keep_the_defaults_they_do_not_name() {
let measure: MeasureThresholds = serde_json::from_str(r#"{"cutoffRangeDb": 50.0}"#).unwrap();
assert_eq!(
measure,
MeasureThresholds {
cutoff_range_db: 50.0,
..MeasureThresholds::default()
}
);
let reading: ReadingThresholds = serde_json::from_str(r#"{"sharpShelfDb": 40.0}"#).unwrap();
assert_eq!(
reading,
ReadingThresholds {
sharp_shelf_db: 40.0,
..ReadingThresholds::default()
}
);
}
fn refused<T: serde::de::DeserializeOwned>(json: &str) {
assert!(
serde_json::from_str::<T>(json).is_err(),
"{json} is refused"
);
}
#[test]
fn a_key_no_threshold_has_is_refused_at_every_level() {
refused::<MeasureThresholds>(r#"{"cutoffRange": 50.0}"#);
refused::<ReadingThresholds>(r#"{"sharpShelf": 40.0}"#);
refused::<ReadingThresholds>(
r#"{"profiles": [{"hz": 16000.0, "codec": "a", "setting": "b", "kbps": 128, "guid": "A"}]}"#,
);
refused::<ReadingThresholds>(
r#"{"otherRateEdges": [{"hz": 15000.0, "rate": "30 kHz", "source": "a"}]}"#,
);
}
}