pub struct Ndsp { /* private fields */ }
Expand description
Handle to the DSP service.
Only one handle for this service can exist at a time.
Implementations§
source§impl Ndsp
impl Ndsp
sourcepub fn new() -> Result<Self>
pub fn new() -> Result<Self>
Initialize the DSP service and audio units.
§Errors
This function will return an error if an instance of the Ndsp
struct already exists
or if there are any issues during initialization (for example, DSP firmware
cannot be found. See module documentation for more details.).
§Example
use ctru::services::ndsp::Ndsp;
let ndsp = Ndsp::new()?;
sourcepub fn set_output_mode(&mut self, mode: OutputMode)
pub fn set_output_mode(&mut self, mode: OutputMode)
Set the audio output mode. Defaults to OutputMode::Stereo
.
§Example
use ctru::services::ndsp::{Ndsp, OutputMode};
let mut ndsp = Ndsp::new()?;
// Use dual-channel output.
ndsp.set_output_mode(OutputMode::Stereo);