oml_audio/audio/
audio_stub.rs1
2use crate::FileLoader;
3use crate::Music;
4use crate::SoundBank;
5use std::time::Instant; #[derive(Debug)]
10pub struct AudioStub {
11 last_now: Instant,
12 capture_buffer: Vec< f32 >,
13}
14
15impl AudioStub {
16 pub fn new() -> Self {
17 Self {
18 last_now: Instant::now(),
19 capture_buffer: Vec::new(),
20 }
21 }
22
23 pub fn update( &mut self ) -> f64 {
24 let timestep = self.last_now.elapsed().as_secs_f64();
25 self.last_now = Instant::now();
26
27 timestep
28 }
29
30 pub fn load_music( &mut self, fileloader: &mut impl FileLoader, filename: &str ) -> bool {
31true
33 }
34
35 pub fn play_music( &mut self ) {
36}
38 pub fn pause_music( &mut self ) {
39}
41
42 pub fn load_sound_bank( &mut self, fileloader: &mut impl FileLoader, filename: &str ) {
43}
45
46 pub fn play_sound( &mut self, name: &str ) {
47}
49
50 pub fn capture( &mut self, size: usize ) {
51 }
52
53 pub fn capture_buffer_slice( &self ) -> &[f32] {
54 self.capture_buffer.as_slice()
55 }
56
57}