()
| 71 | |
| 72 | impl AudioSystem { |
| 73 | pub fn new() -> Self { |
| 74 | let mut cx = FirewheelContext::new(Default::default()); |
| 75 | let stream = CpalStream::new( |
| 76 | &mut cx, |
| 77 | CpalConfig { |
| 78 | output: Default::default(), |
| 79 | input: Some(Default::default()), |
| 80 | }, |
| 81 | ) |
| 82 | .unwrap(); |
| 83 | |
| 84 | let sample_rate = cx.stream_info().unwrap().sample_rate; |
| 85 | |
| 86 | let cache = SymphoniumCache::default(); |
| 87 | |
| 88 | // Load all samples |
| 89 | let samples = SAMPLE_PATHS |
| 90 | .iter() |
| 91 | .map(|path| { |
| 92 | let probed = symphonium::probe_from_file( |
| 93 | path, None, // Custom container probe |
| 94 | ) |
| 95 | .unwrap(); |
| 96 | firewheel::dyn_symphonium_resource( |
| 97 | symphonium::decode( |
| 98 | probed, |
| 99 | &symphonium::DecodeConfig::default(), |
| 100 | Some(sample_rate), // target sample rate |
| 101 | Some(&cache), // An optional cache |
| 102 | None, // Custom codec registry |
| 103 | ) |
| 104 | .unwrap(), |
| 105 | ) |
| 106 | }) |
| 107 | .collect(); |
| 108 | |
| 109 | let loaded = IR_SAMPLE_PATHS |
| 110 | .iter() |
| 111 | .map(|path| { |
| 112 | let probed = symphonium::probe_from_file( |
| 113 | path, None, // Custom container probe |
| 114 | ) |
| 115 | .unwrap(); |
| 116 | SymphoniumAudioF32( |
| 117 | symphonium::decode_f32( |
| 118 | probed, |
| 119 | &symphonium::DecodeConfig::default(), |
| 120 | Some(sample_rate), // target sample rate |
| 121 | Some(&cache), // An optional cache |
| 122 | None, // Custom codec registry |
| 123 | ) |
| 124 | .unwrap(), |
| 125 | ) |
| 126 | }) |
| 127 | .collect::<Vec<_>>(); |
| 128 | |
| 129 | // Process samples to get multiple channels from few files |
| 130 | let ir_samples = vec![ |
nothing calls this directly
no test coverage detected