Skip to main content

SoundConfig

Struct SoundConfig 

Source
pub struct SoundConfig { /* private fields */ }
Expand description

Hardware and output configuration. Builders are validated by DosAudio::split.

Implementations§

Source§

impl SoundConfig

Source

pub fn none() -> Self

No installed sound hardware.

Source

pub fn adlib() -> Self

An AdLib with an OPL2 at ports 388h/389h.

Source

pub fn sb2() -> Self

Sound Blaster 2.0 at 220h, IRQ 5, DMA 1, with its OPL2.

Source

pub fn sb1() -> Self

An original Sound Blaster using the default ISA resources.

Source

pub fn sb_pro() -> Self

A first-generation Sound Blaster Pro with dual OPL2.

Source

pub fn sb_pro2() -> Self

A Sound Blaster Pro 2 with OPL3.

Source

pub fn sb16() -> Self

A Sound Blaster 16, with byte DMA 1 and word DMA 5.

Source

pub fn sb_model(self, model: SbModel) -> Self

Select a DSP model, installing default ISA resources if no card is present.

Source

pub fn dma16(self, channel: u8) -> Self

Select SB16 DMA: word channel 5/6/7, or the same byte channel as D.

Source

pub fn from_blaster(value: &str) -> Result<Self>

Parse a BLASTER value containing A (hex), I, D, T and optional H fields.

A/I/D/T are required; T values 1/2/3/4/6 select SB1/Pro/SB2/Pro2/SB16. H is valid only for SB16 and defaults to 5. Unknown or duplicate fields are errors. Resource and feature validation also runs at construction.

Source

pub fn sound_blaster(self, resources: SoundBlasterConfig) -> Self

Install a Sound Blaster 2.0 and its OPL2 using the supplied ISA resources.

Source

pub fn opl3() -> Self

An OPL3 at ports 388h through 38Bh.

Source

pub fn dual_opl2() -> Self

Two OPL2 chips at ports 388h through 38Bh.

Source

pub fn speaker(self, enabled: bool) -> Self

Install or remove PIT channel 2 and the PC speaker.

Source

pub fn mpu401(self, backend: MidiBackend) -> Self

Install an MPU-401 UART and MIDI synthesis backend.

Source

pub fn midi_port(self, base: u16) -> Self

Relocate the MPU-401 to an aligned base in 300h through 360h.

Source

pub fn psg(self, enabled: bool) -> Self

Install or remove the Tandy SN76489 PSG at C0h.

Source

pub fn opl_backend(self, backend: OplBackend) -> Self

Select the FM synthesis backend.

Source

pub fn sample_rate(self, sample_rate: u32) -> Self

Output sample rate, from 8,000 through 192,000 Hz.

Source

pub fn queue_capacity(self, capacity: usize) -> Self

Fixed command queue capacity; must be nonzero.

Source

pub fn latency(self, latency: Tick) -> Self

Delay timestamped port writes by this much output time.

Live playback defaults to 10 ms. Offline machines force zero latency. Increase this for a host with a larger audio callback or game-frame jitter.

Trait Implementations§

Source§

impl Clone for SoundConfig

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SoundConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SoundConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

Source§

fn into_sample(self) -> T

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.