|
libultraship
Reimplementations of libultra (N64 SDK) functions for modern hardware
|
A no-op AudioPlayer used when no audio device is available or audio is disabled. More...
#include <NullAudioPlayer.h>
Public Member Functions | |
| NullAudioPlayer (AudioSettings settings) | |
| Constructs a NullAudioPlayer with the given audio settings. | |
| ~NullAudioPlayer () | |
| int | Buffered () override |
| Returns the desired buffered frame count so the game always produces audio. | |
Public Member Functions inherited from Ship::AudioPlayer | |
| AudioPlayer (AudioSettings settings) | |
| Constructs an AudioPlayer with the given configuration. | |
| ~AudioPlayer () | |
| bool | Init () |
| Calls DoInit() and sets the initialised flag on success. | |
| void | Play (const uint8_t *buf, size_t len) |
| Submits a frame of PCM audio to the output device. | |
| bool | IsInitialized () |
| Returns true if Init() has been called and succeeded. | |
| int32_t | GetSampleRate () const |
| Returns the configured output sample rate in Hz. | |
| int32_t | GetSampleLength () const |
| Returns the configured number of samples per audio frame. | |
| int32_t | GetDesiredBuffered () const |
| Returns the target number of frames to keep buffered. | |
| AudioChannelsSetting | GetAudioChannels () const |
| Returns the current channel-output mode. | |
| void | SetSampleRate (int32_t rate) |
| Sets the output sample rate. | |
| void | SetSampleLength (int32_t length) |
| Sets the number of samples per audio frame. | |
| void | SetDesiredBuffered (int32_t size) |
| Sets the target number of buffered frames. | |
| bool | SetAudioChannels (AudioChannelsSetting channels) |
| Changes the channel mode and reinitialises the audio device. | |
| int32_t | GetNumOutputChannels () const |
| Returns the number of output channels implied by the current channel setting. | |
Protected Member Functions | |
| bool | DoInit () override |
| Always returns true — no actual device needs to be opened. | |
| void | DoClose () override |
| No-op — nothing to close. | |
| void | DoPlay (const uint8_t *buf, size_t len) override |
| Silently discards all audio data. | |
A no-op AudioPlayer used when no audio device is available or audio is disabled.
NullAudioPlayer silently discards all audio data. DoInit() succeeds immediately, Buffered() always returns the desired buffered frame count so the game continues to produce audio at the expected rate, and DoPlay() is a no-op.
This backend is always compiled in and is selected as a fallback when every other backend fails to initialise.
|
inline |
Constructs a NullAudioPlayer with the given audio settings.
| settings | Audio configuration (rates are accepted but otherwise unused). |
| Ship::NullAudioPlayer::~NullAudioPlayer | ( | ) |
|
overridevirtual |
Returns the desired buffered frame count so the game always produces audio.
Implements Ship::AudioPlayer.
|
overrideprotectedvirtual |
No-op — nothing to close.
Implements Ship::AudioPlayer.
|
overrideprotectedvirtual |
Always returns true — no actual device needs to be opened.
Implements Ship::AudioPlayer.
|
overrideprotectedvirtual |
Silently discards all audio data.
Implements Ship::AudioPlayer.