feat(audio): add 32-voice PCM mixing and native music sequencing
Add self-contained SoundBanks and MusicBanks with per-sample PCM16 and IMA ADPCM storage, materialized to resident PCM16. Integrate instrument envelopes, automation, shared DSP and host lifecycle controls while preserving staged real-time execution.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#![allow(clippy::collapsible_if)]
|
||||
mod decode;
|
||||
mod resumable;
|
||||
use crate::audio::bank_format::{DecodedAudioBank, decode_audio_bank};
|
||||
use crate::memory_banks::{GlyphBankPoolInstaller, SceneBankPoolInstaller, SoundBankPoolInstaller};
|
||||
use prometeu_hal::AssetBridge;
|
||||
use prometeu_hal::asset::{
|
||||
@@ -14,7 +15,7 @@ use prometeu_hal::cartridge::AssetsPayloadSource;
|
||||
use prometeu_hal::color::Color;
|
||||
use prometeu_hal::glyph::Glyph;
|
||||
use prometeu_hal::glyph_bank::{GlyphBank, TileSize};
|
||||
use prometeu_hal::sample::Sample;
|
||||
use prometeu_hal::music_bank::MusicBank;
|
||||
use prometeu_hal::scene_bank::SceneBank;
|
||||
use prometeu_hal::scene_layer::{ParallaxFactor, SceneLayer};
|
||||
use prometeu_hal::sound_bank::SoundBank;
|
||||
@@ -61,6 +62,7 @@ pub struct AssetPipelineTelemetry {
|
||||
pub active_progress: u16,
|
||||
pub glyph_latency: AssetLatencyPercentiles,
|
||||
pub sound_latency: AssetLatencyPercentiles,
|
||||
pub music_latency: AssetLatencyPercentiles,
|
||||
pub scene_latency: AssetLatencyPercentiles,
|
||||
pub last_asset_id: Option<AssetId>,
|
||||
pub last_asset_latency: AssetLatencyPercentiles,
|
||||
@@ -130,6 +132,7 @@ impl AssetPipelineTelemetryState {
|
||||
);
|
||||
self.snapshot.glyph_latency = percentile_snapshot(self.bank_samples.get(&BankType::GLYPH));
|
||||
self.snapshot.sound_latency = percentile_snapshot(self.bank_samples.get(&BankType::SOUNDS));
|
||||
self.snapshot.music_latency = percentile_snapshot(self.bank_samples.get(&BankType::MUSIC));
|
||||
self.snapshot.scene_latency = percentile_snapshot(self.bank_samples.get(&BankType::SCENE));
|
||||
self.snapshot.last_asset_id = Some(asset_id);
|
||||
self.snapshot.last_asset_latency = percentile_snapshot(self.asset_samples.get(&asset_id));
|
||||
@@ -329,12 +332,14 @@ pub struct AssetManager {
|
||||
gfx_slots: Arc<RwLock<[Option<AssetId>; 16]>>,
|
||||
glyph_slot_index: GlyphAssetSlotIndex,
|
||||
sound_slots: Arc<RwLock<[Option<AssetId>; 16]>>,
|
||||
music_slots: Arc<RwLock<[Option<AssetId>; 16]>>,
|
||||
scene_slots: Arc<RwLock<[Option<AssetId>; 16]>>,
|
||||
|
||||
/// Residency policy for GFX glyph banks.
|
||||
gfx_policy: BankPolicy<GlyphBank>,
|
||||
/// Residency policy for sound banks.
|
||||
sound_policy: BankPolicy<SoundBank>,
|
||||
music_policy: BankPolicy<MusicBank>,
|
||||
/// Residency policy for scene banks.
|
||||
scene_policy: BankPolicy<SceneBank>,
|
||||
|
||||
@@ -370,6 +375,7 @@ struct AssetLoadJobResources<'a> {
|
||||
pipeline_telemetry: &'a Arc<Mutex<AssetPipelineTelemetryState>>,
|
||||
gfx_policy: &'a BankPolicy<GlyphBank>,
|
||||
sound_policy: &'a BankPolicy<SoundBank>,
|
||||
music_policy: &'a BankPolicy<MusicBank>,
|
||||
scene_policy: &'a BankPolicy<SceneBank>,
|
||||
}
|
||||
|
||||
@@ -479,6 +485,7 @@ struct AssetLoadWorker {
|
||||
}
|
||||
|
||||
impl AssetLoadWorker {
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
fn new(
|
||||
handles: Arc<RwLock<HandleTable>>,
|
||||
target_generations: Arc<RwLock<TargetGenerationTable>>,
|
||||
@@ -486,6 +493,7 @@ impl AssetLoadWorker {
|
||||
pipeline_telemetry: Arc<Mutex<AssetPipelineTelemetryState>>,
|
||||
gfx_policy: BankPolicy<GlyphBank>,
|
||||
sound_policy: BankPolicy<SoundBank>,
|
||||
music_policy: BankPolicy<MusicBank>,
|
||||
scene_policy: BankPolicy<SceneBank>,
|
||||
) -> Self {
|
||||
let queue = Arc::new(AssetLoadQueue::default());
|
||||
@@ -498,6 +506,7 @@ impl AssetLoadWorker {
|
||||
pipeline_telemetry: &pipeline_telemetry,
|
||||
gfx_policy: &gfx_policy,
|
||||
sound_policy: &sound_policy,
|
||||
music_policy: &music_policy,
|
||||
scene_policy: &scene_policy,
|
||||
};
|
||||
while let Some(job) = worker_queue.next_job() {
|
||||
@@ -554,6 +563,9 @@ enum AssetOpMode {
|
||||
}
|
||||
|
||||
impl AssetBridge for AssetManager {
|
||||
fn unload_audio(&self, music: bool, slot: usize) -> AssetOpStatus {
|
||||
self.unload_audio(music, slot)
|
||||
}
|
||||
fn bind_background_work(
|
||||
&mut self,
|
||||
lane: Arc<dyn prometeu_hal::background_work::BackgroundWork>,
|
||||
@@ -647,7 +659,9 @@ impl AssetManager {
|
||||
fn op_mode_for(entry: &AssetEntry) -> Result<AssetOpMode, String> {
|
||||
match (entry.bank_type, entry.codec) {
|
||||
(BankType::GLYPH, AssetCodec::None) => Ok(AssetOpMode::StageInMemory),
|
||||
(BankType::SOUNDS, AssetCodec::None) => Ok(AssetOpMode::DirectFromSlice),
|
||||
(BankType::SOUNDS, AssetCodec::None) | (BankType::MUSIC, AssetCodec::None) => {
|
||||
Ok(AssetOpMode::DirectFromSlice)
|
||||
}
|
||||
(BankType::SCENE, AssetCodec::None) => Ok(AssetOpMode::DirectFromSlice),
|
||||
}
|
||||
}
|
||||
@@ -670,6 +684,7 @@ impl AssetManager {
|
||||
let pipeline_telemetry = Arc::new(Mutex::new(AssetPipelineTelemetryState::default()));
|
||||
let gfx_policy = BankPolicy::new();
|
||||
let sound_policy = BankPolicy::new();
|
||||
let music_policy = BankPolicy::new();
|
||||
let scene_policy = BankPolicy::new();
|
||||
let load_worker = AssetLoadWorker::new(
|
||||
Arc::clone(&handles),
|
||||
@@ -678,6 +693,7 @@ impl AssetManager {
|
||||
Arc::clone(&pipeline_telemetry),
|
||||
gfx_policy.clone(),
|
||||
sound_policy.clone(),
|
||||
music_policy.clone(),
|
||||
scene_policy.clone(),
|
||||
);
|
||||
|
||||
@@ -689,9 +705,11 @@ impl AssetManager {
|
||||
gfx_slots: Arc::new(RwLock::new(std::array::from_fn(|_| None))),
|
||||
glyph_slot_index: GlyphAssetSlotIndex::new(),
|
||||
sound_slots: Arc::new(RwLock::new(std::array::from_fn(|_| None))),
|
||||
music_slots: Arc::new(RwLock::new(std::array::from_fn(|_| None))),
|
||||
scene_slots: Arc::new(RwLock::new(std::array::from_fn(|_| None))),
|
||||
gfx_policy,
|
||||
sound_policy,
|
||||
music_policy,
|
||||
scene_policy,
|
||||
handles,
|
||||
target_handles: Arc::new(RwLock::new(HashMap::new())),
|
||||
@@ -776,6 +794,23 @@ impl AssetManager {
|
||||
}
|
||||
}
|
||||
}
|
||||
BankType::MUSIC => {
|
||||
if let Ok(bank) =
|
||||
Self::perform_load_music_bank(&entry, self.assets_data.clone())
|
||||
{
|
||||
let bank_arc = Arc::new(bank);
|
||||
self.music_policy.put_resident(
|
||||
entry.asset_id,
|
||||
Arc::clone(&bank_arc),
|
||||
entry.decoded_size as usize,
|
||||
);
|
||||
self.sound_installer.install_music_bank(slot_index, bank_arc);
|
||||
let mut slots = self.music_slots.write().unwrap();
|
||||
if slot_index < slots.len() {
|
||||
slots[slot_index] = Some(entry.asset_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
BankType::SCENE => {
|
||||
if let Ok(bank) =
|
||||
Self::perform_load_scene_bank(&entry, self.assets_data.clone())
|
||||
@@ -840,6 +875,7 @@ impl AssetManager {
|
||||
fn clear_staging_for_handle(&self, handle_id: HandleId) {
|
||||
self.gfx_policy.take_staging(handle_id);
|
||||
self.sound_policy.take_staging(handle_id);
|
||||
self.music_policy.take_staging(handle_id);
|
||||
self.scene_policy.take_staging(handle_id);
|
||||
}
|
||||
|
||||
@@ -855,6 +891,7 @@ impl AssetManager {
|
||||
match slot.asset_type {
|
||||
BankType::GLYPH => self.gfx_slots.read().unwrap().get(slot.index).and_then(|s| *s),
|
||||
BankType::SOUNDS => self.sound_slots.read().unwrap().get(slot.index).and_then(|s| *s),
|
||||
BankType::MUSIC => self.music_slots.read().unwrap().get(slot.index).and_then(|s| *s),
|
||||
BankType::SCENE => self.scene_slots.read().unwrap().get(slot.index).and_then(|s| *s),
|
||||
}
|
||||
}
|
||||
@@ -874,6 +911,7 @@ impl AssetManager {
|
||||
let slot = match entry.bank_type {
|
||||
BankType::GLYPH => SlotRef::gfx(slot_index),
|
||||
BankType::SOUNDS => SlotRef::audio(slot_index),
|
||||
BankType::MUSIC => SlotRef::music(slot_index),
|
||||
BankType::SCENE => SlotRef::scene(slot_index),
|
||||
};
|
||||
|
||||
@@ -899,6 +937,14 @@ impl AssetManager {
|
||||
false
|
||||
}
|
||||
}
|
||||
BankType::MUSIC => {
|
||||
if let Some(bank) = self.music_policy.get_resident(asset_id) {
|
||||
self.music_policy.stage(handle_id, bank, entry.decoded_size as usize);
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
BankType::SCENE => {
|
||||
if let Some(bank) = self.scene_policy.get_resident(asset_id) {
|
||||
self.scene_policy.stage(handle_id, bank, entry.decoded_size as usize);
|
||||
@@ -1081,6 +1127,57 @@ impl AssetManager {
|
||||
}
|
||||
}
|
||||
}
|
||||
BankType::MUSIC => {
|
||||
let result =
|
||||
Self::perform_load_music_bank(&job.entry, Arc::clone(resources.assets_data));
|
||||
match result {
|
||||
Ok(musicbank) => {
|
||||
if !Self::is_current_target_generation(
|
||||
resources.target_generations,
|
||||
job.slot,
|
||||
job.request_generation,
|
||||
) {
|
||||
resources.pipeline_telemetry.lock().unwrap().record_stale_discard();
|
||||
return;
|
||||
}
|
||||
let bank_arc = Arc::new(musicbank);
|
||||
let resident_arc = resources.music_policy.put_resident(
|
||||
job.asset_id,
|
||||
bank_arc,
|
||||
job.entry.decoded_size as usize,
|
||||
);
|
||||
if !Self::is_current_target_generation(
|
||||
resources.target_generations,
|
||||
job.slot,
|
||||
job.request_generation,
|
||||
) {
|
||||
resources.pipeline_telemetry.lock().unwrap().record_stale_discard();
|
||||
return;
|
||||
}
|
||||
resources.music_policy.stage(
|
||||
job.handle_id,
|
||||
resident_arc,
|
||||
job.entry.decoded_size as usize,
|
||||
);
|
||||
Self::complete_load_job(resources.handles, &job, LoadStatus::READY);
|
||||
Self::record_load_job_finished(
|
||||
resources.pipeline_telemetry,
|
||||
&job,
|
||||
started_at,
|
||||
LoadStatus::READY,
|
||||
);
|
||||
}
|
||||
Err(_) => {
|
||||
Self::complete_load_job(resources.handles, &job, LoadStatus::ERROR);
|
||||
Self::record_load_job_finished(
|
||||
resources.pipeline_telemetry,
|
||||
&job,
|
||||
started_at,
|
||||
LoadStatus::ERROR,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
BankType::SCENE => {
|
||||
let result =
|
||||
Self::perform_load_scene_bank(&job.entry, Arc::clone(resources.assets_data));
|
||||
@@ -1268,6 +1365,32 @@ impl AssetManager {
|
||||
}
|
||||
}
|
||||
|
||||
fn perform_load_music_bank(
|
||||
entry: &AssetEntry,
|
||||
assets_data: Arc<RwLock<AssetsPayloadSource>>,
|
||||
) -> Result<MusicBank, String> {
|
||||
let op_mode = Self::op_mode_for(entry)?;
|
||||
let slice = {
|
||||
let assets_data = assets_data.read().unwrap();
|
||||
assets_data
|
||||
.open_slice(entry.offset, entry.size)
|
||||
.map_err(|_| "Asset offset/size out of bounds".to_string())?
|
||||
};
|
||||
|
||||
match op_mode {
|
||||
AssetOpMode::DirectFromSlice => {
|
||||
let mut reader =
|
||||
slice.open_reader().map_err(|_| "Asset payload read failed".to_string())?;
|
||||
Self::decode_music_bank_from_reader(entry, &mut reader)
|
||||
}
|
||||
AssetOpMode::StageInMemory => {
|
||||
let buffer =
|
||||
slice.read_all().map_err(|_| "Asset payload read failed".to_string())?;
|
||||
Self::decode_music_bank_from_buffer(entry, &buffer)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn perform_load_scene_bank(
|
||||
entry: &AssetEntry,
|
||||
assets_data: Arc<RwLock<AssetsPayloadSource>>,
|
||||
@@ -1334,13 +1457,32 @@ impl AssetManager {
|
||||
entry: &AssetEntry,
|
||||
buffer: &[u8],
|
||||
) -> Result<SoundBank, String> {
|
||||
let sample_rate = decode::sound_rate(entry)?;
|
||||
decode::payload_size(entry, buffer.len())?;
|
||||
let mut data = Vec::with_capacity(buffer.len() / 2);
|
||||
decode::append_pcm(&mut data, buffer);
|
||||
let bank = decode_audio_bank(buffer, false)?;
|
||||
if bank.decoded_size() as u64 != entry.decoded_size {
|
||||
return Err("audio decoded_size mismatch".into());
|
||||
}
|
||||
if let DecodedAudioBank::Sound(bank) = bank {
|
||||
Ok(bank)
|
||||
} else {
|
||||
Err("audio bank type mismatch".into())
|
||||
}
|
||||
}
|
||||
|
||||
let sample = Arc::new(Sample::new(sample_rate, data));
|
||||
Ok(SoundBank::new(vec![sample]))
|
||||
fn decode_music_bank_from_buffer(
|
||||
entry: &AssetEntry,
|
||||
buffer: &[u8],
|
||||
) -> Result<MusicBank, String> {
|
||||
decode::payload_size(entry, buffer.len())?;
|
||||
let bank = decode_audio_bank(buffer, true)?;
|
||||
if bank.decoded_size() as u64 != entry.decoded_size {
|
||||
return Err("audio decoded_size mismatch".into());
|
||||
}
|
||||
if let DecodedAudioBank::Music(bank) = bank {
|
||||
Ok(bank)
|
||||
} else {
|
||||
Err("audio bank type mismatch".into())
|
||||
}
|
||||
}
|
||||
|
||||
fn decode_sound_bank_from_reader(
|
||||
@@ -1352,6 +1494,15 @@ impl AssetManager {
|
||||
Self::decode_sound_bank_from_buffer(entry, &raw)
|
||||
}
|
||||
|
||||
fn decode_music_bank_from_reader(
|
||||
entry: &AssetEntry,
|
||||
reader: &mut impl Read,
|
||||
) -> Result<MusicBank, String> {
|
||||
let mut raw = Vec::new();
|
||||
reader.read_to_end(&mut raw).map_err(|_| "Asset payload read failed".to_string())?;
|
||||
Self::decode_music_bank_from_buffer(entry, &raw)
|
||||
}
|
||||
|
||||
pub fn status(&self, handle: HandleId) -> LoadStatus {
|
||||
if let Some(status) = self.handles.read().unwrap().get(&handle).map(|h| h.status) {
|
||||
return status;
|
||||
@@ -1480,6 +1631,7 @@ impl AssetManager {
|
||||
let slot_ref = match bank_type {
|
||||
BankType::GLYPH => SlotRef::gfx(slot),
|
||||
BankType::SOUNDS => SlotRef::audio(slot),
|
||||
BankType::MUSIC => SlotRef::music(slot),
|
||||
BankType::SCENE => SlotRef::scene(slot),
|
||||
};
|
||||
let handle = self.handle_for_slot(slot_ref);
|
||||
@@ -1595,6 +1747,16 @@ impl AssetManager {
|
||||
h.status = LoadStatus::COMMITTED;
|
||||
}
|
||||
}
|
||||
BankType::MUSIC => {
|
||||
if let Some((bank, _)) = self.music_policy.take_staging(handle_id) {
|
||||
self.sound_installer.install_music_bank(h.slot.index, bank);
|
||||
let mut slots = self.music_slots.write().unwrap();
|
||||
if h.slot.index < slots.len() {
|
||||
slots[h.slot.index] = Some(h._asset_id);
|
||||
}
|
||||
h.status = LoadStatus::COMMITTED;
|
||||
}
|
||||
}
|
||||
BankType::SCENE => {
|
||||
if let Some((bank, _)) = self.scene_policy.take_staging(handle_id) {
|
||||
self.scene_installer.install_scene_bank(h.slot.index, bank);
|
||||
@@ -1609,12 +1771,57 @@ impl AssetManager {
|
||||
}
|
||||
}
|
||||
}
|
||||
self.reap_audio_cache();
|
||||
}
|
||||
|
||||
fn reap_audio_cache(&self) {
|
||||
fn reap<T>(policy: &BankPolicy<T>, slots: &[Option<AssetId>; 16]) {
|
||||
let mut resident = policy.resident.write().unwrap();
|
||||
resident.retain(|id, entry| {
|
||||
let keep = slots.contains(&Some(*id)) || Arc::strong_count(&entry.value) > 1;
|
||||
if !keep {
|
||||
policy.used_bytes.fetch_sub(entry.bytes, Ordering::Relaxed);
|
||||
}
|
||||
keep
|
||||
});
|
||||
}
|
||||
reap(&self.sound_policy, &self.sound_slots.read().unwrap());
|
||||
reap(&self.music_policy, &self.music_slots.read().unwrap());
|
||||
}
|
||||
|
||||
pub fn unload_audio(&self, music: bool, slot: usize) -> AssetOpStatus {
|
||||
if slot >= 16 {
|
||||
return AssetOpStatus::InvalidState;
|
||||
}
|
||||
let target = if music { SlotRef::music(slot) } else { SlotRef::audio(slot) };
|
||||
self.bump_target_generation(target);
|
||||
if let Some(handle) = self.target_handles.read().unwrap().get(&target).copied() {
|
||||
self.clear_staging_for_handle(handle);
|
||||
if let Some(h) = self.handles.write().unwrap().get_mut(&handle) {
|
||||
h.status = LoadStatus::CANCELED;
|
||||
}
|
||||
}
|
||||
let slots = if music { &self.music_slots } else { &self.sound_slots };
|
||||
let mut ids = slots.write().unwrap();
|
||||
let previous = ids[slot].take();
|
||||
self.sound_installer.unload_audio_bank(music, slot);
|
||||
if let Some(id) = previous.filter(|id| !ids.contains(&Some(*id))) {
|
||||
if music {
|
||||
if let Some(old) = self.music_policy.resident.write().unwrap().remove(&id) {
|
||||
self.music_policy.used_bytes.fetch_sub(old.bytes, Ordering::Relaxed);
|
||||
}
|
||||
} else if let Some(old) = self.sound_policy.resident.write().unwrap().remove(&id) {
|
||||
self.sound_policy.used_bytes.fetch_sub(old.bytes, Ordering::Relaxed);
|
||||
}
|
||||
}
|
||||
AssetOpStatus::Ok
|
||||
}
|
||||
|
||||
pub fn bank_telemetry(&self) -> Vec<BankTelemetry> {
|
||||
vec![
|
||||
self.bank_telemetry_for(BankType::GLYPH),
|
||||
self.bank_telemetry_for(BankType::SOUNDS),
|
||||
self.bank_telemetry_for(BankType::MUSIC),
|
||||
self.bank_telemetry_for(BankType::SCENE),
|
||||
]
|
||||
}
|
||||
@@ -1627,6 +1834,9 @@ impl AssetManager {
|
||||
BankType::SOUNDS => {
|
||||
self.sound_slots.read().unwrap().iter().filter(|slot| slot.is_some()).count()
|
||||
}
|
||||
BankType::MUSIC => {
|
||||
self.music_slots.read().unwrap().iter().filter(|slot| slot.is_some()).count()
|
||||
}
|
||||
BankType::SCENE => {
|
||||
self.scene_slots.read().unwrap().iter().filter(|slot| slot.is_some()).count()
|
||||
}
|
||||
@@ -1679,6 +1889,27 @@ impl AssetManager {
|
||||
|
||||
SlotStats { asset_id, asset_name, generation: 0, resident_bytes: bytes }
|
||||
}
|
||||
BankType::MUSIC => {
|
||||
let slots = self.music_slots.read().unwrap();
|
||||
let asset_id = slots.get(slot.index).and_then(|s| *s);
|
||||
|
||||
let (bytes, asset_name) = if let Some(id) = &asset_id {
|
||||
let bytes = self
|
||||
.music_policy
|
||||
.resident
|
||||
.read()
|
||||
.unwrap()
|
||||
.get(id)
|
||||
.map(|entry| entry.bytes)
|
||||
.unwrap_or(0);
|
||||
let name = self.assets.read().unwrap().get(id).map(|e| e.asset_name.clone());
|
||||
(bytes, name)
|
||||
} else {
|
||||
(0, None)
|
||||
};
|
||||
|
||||
SlotStats { asset_id, asset_name, generation: 0, resident_bytes: bytes }
|
||||
}
|
||||
BankType::SCENE => {
|
||||
let slots = self.scene_slots.read().unwrap();
|
||||
let asset_id = slots.get(slot.index).and_then(|s| *s);
|
||||
@@ -1711,6 +1942,7 @@ impl AssetManager {
|
||||
}
|
||||
self.gfx_policy.clear();
|
||||
self.sound_policy.clear();
|
||||
self.music_policy.clear();
|
||||
self.scene_policy.clear();
|
||||
self.handles.write().unwrap().clear();
|
||||
self.target_handles.write().unwrap().clear();
|
||||
@@ -1721,9 +1953,11 @@ impl AssetManager {
|
||||
self.gfx_slots.write().unwrap().fill(None);
|
||||
self.glyph_slot_index.clear();
|
||||
self.sound_slots.write().unwrap().fill(None);
|
||||
self.music_slots.write().unwrap().fill(None);
|
||||
self.scene_slots.write().unwrap().fill(None);
|
||||
self.gfx_installer.clear_glyph_banks();
|
||||
self.sound_installer.clear_sound_banks();
|
||||
self.sound_installer.clear_music_banks();
|
||||
self.scene_installer.clear_scene_banks();
|
||||
}
|
||||
|
||||
@@ -2512,7 +2746,7 @@ mod tests {
|
||||
let scene_installer = Arc::clone(&banks) as Arc<dyn SceneBankPoolInstaller>;
|
||||
|
||||
// 100 samples of 16-bit PCM (zeros)
|
||||
let data = vec![0u8; 200];
|
||||
let data = crate::bank_format::test_pcm_bank(&[0u8; 200], 44100);
|
||||
|
||||
let asset_entry = AssetEntry {
|
||||
asset_id: 1,
|
||||
@@ -2558,7 +2792,7 @@ mod tests {
|
||||
let sound_installer = Arc::clone(&banks) as Arc<dyn SoundBankPoolInstaller>;
|
||||
let scene_installer = Arc::clone(&banks) as Arc<dyn SceneBankPoolInstaller>;
|
||||
|
||||
let data = vec![0u8; 200];
|
||||
let data = crate::bank_format::test_pcm_bank(&[0u8; 200], 44100);
|
||||
|
||||
let asset_entry = AssetEntry {
|
||||
asset_id: 2,
|
||||
|
||||
Reference in New Issue
Block a user