Skip to main content

limnus_audio_device/
lib.rs

1/*
2 * Copyright (c) Peter Bjorklund. All rights reserved. https://github.com/swamp/limnus
3 * Licensed under the MIT License. See LICENSE in the project root for license information.
4 */
5use crate::low_level::Audio;
6use limnus_app::prelude::{App, Plugin};
7use tracing::error;
8
9pub mod low_level;
10
11pub struct AudioDevicePlugin;
12
13impl Plugin for AudioDevicePlugin {
14    fn build(&self, app: &mut App) {
15        let result = Audio::new();
16        if let Ok(audio) = result {
17            app.insert_local_resource(audio);
18        } else {
19            error!(
20                err = result.unwrap_err(),
21                "could not initialize audio thread "
22            );
23        }
24    }
25}