[][src]Struct cat_engine::audio::Audio

pub struct Audio { /* fields omitted */ }

Простой аудио движок. Simple audio engine.

Пока только вывод доступен.

Only output is available now.

Implementations

impl Audio[src]

pub fn new(settings: AudioSettings) -> Result<Audio>[src]

For default host and device.

Returns the result of starting an audio thread.

pub fn with_host_and_device(
    settings: AudioSettings,
    host: Host,
    device: Device
) -> Result<Audio>
[src]

For given host and device.

Returns the result of starting the audio thread.

pub fn available_hosts() -> Vec<HostId>[src]

pub fn host_from_id(id: HostId) -> Result<Host, HostUnavailable>[src]

pub fn default_output_device() -> Option<Device>[src]

Может вызвать панику, если окно запущено в том же потоке.

This function may panic if the window is running in the same thread.

pub fn output_devices() -> Result<OutputDevices<Devices>, DevicesError>[src]

Возвращает все доступные устройства текущего хоста.

Может вызвать панику, если окно запущено в том же потоке.

Returns all available devices of the default host.

This function may panic if the window is running in the same thread.

pub fn add_track<P: AsRef<Path>>(&self, path: P) -> AudioCommandResult[src]

Добавляет трек в массив треков.

Adds the track to the track array.

pub fn remove_track(&self, index: usize) -> AudioCommandResult[src]

Удаляет трек из массива треков.

Removes the track from the track array.

pub fn remove_all_tracks(&self) -> AudioCommandResult[src]

Удаляет все треки из массива треков.

Removes all tracks from the track array.

pub fn play_once(&self, index: usize) -> AudioCommandResult[src]

Запускает трек без повторов.

Sets the track to play once.

pub fn play_forever(&self, index: usize) -> AudioCommandResult[src]

Запускает трек, который постоянно повторяется.

Sets the track to play forever.

pub fn play(&self) -> AudioCommandResult[src]

Запускает проигрывание канала.

Starts playing the stream.

pub fn pause(&self) -> AudioCommandResult[src]

Ставит на паузу проигрывание канала.

Pauses the stream.

pub fn stop(&self) -> AudioCommandResult[src]

Останавливает проигрывание путём удаления трека из буфера для вывода.

Stops playing by removing current track from playing buffer.

pub fn set_volume(&self, volume: f32) -> AudioCommandResult[src]

Устанавливает громкость.

Sets the volume.

Trait Implementations

impl Drop for Audio[src]

Отправляет команду для остановки и ожидает окончание работы потока.

Sends closing command and then waits for the thread to finish.

Auto Trait Implementations

impl !RefUnwindSafe for Audio

impl Send for Audio

impl !Sync for Audio

impl Unpin for Audio

impl !UnwindSafe for Audio

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SetParameter for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.