libultraship
Reimplementations of libultra (N64 SDK) functions for modern hardware
Loading...
Searching...
No Matches
audiobridge.h File Reference
#include "stdint.h"
#include "stddef.h"
#include "ship/Api.h"
#include "ship/audio/AudioChannelsSetting.h"
#include <memory>
Include dependency graph for audiobridge.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  Ship
 Core namespace for the libultraship engine framework.
 

Functions

void AudioSetAudioComponent (std::shared_ptr< Ship::Audio > audio)
 
std::shared_ptr< Ship::AudioAudioGetAudioComponent ()
 
API_EXPORT int32_t AudioPlayerBuffered ()
 Returns the number of audio frames currently queued in the audio device buffer.
 
API_EXPORT int32_t AudioPlayerGetDesiredBuffered ()
 Returns the configured target number of buffered audio frames.
 
API_EXPORT AudioChannelsSetting GetAudioChannels ()
 Returns the current audio channel mode (stereo / 5.1 matrix / 5.1 raw).
 
API_EXPORT int32_t GetNumAudioChannels ()
 Returns the number of output channels active on the current audio device (2 or 6).
 
API_EXPORT void AudioPlayerPlayFrame (const uint8_t *buf, size_t len)
 Submits a frame of PCM audio to the audio output device.
 
API_EXPORT void SetAudioChannels (AudioChannelsSetting channels)
 Changes the audio channel configuration at runtime.
 

Function Documentation

◆ AudioGetAudioComponent()

std::shared_ptr< Ship::Audio > AudioGetAudioComponent ( )

◆ AudioPlayerBuffered()

API_EXPORT int32_t AudioPlayerBuffered ( )

Returns the number of audio frames currently queued in the audio device buffer.

◆ AudioPlayerGetDesiredBuffered()

API_EXPORT int32_t AudioPlayerGetDesiredBuffered ( )

Returns the configured target number of buffered audio frames.

◆ AudioPlayerPlayFrame()

API_EXPORT void AudioPlayerPlayFrame ( const uint8_t *  buf,
size_t  len 
)

Submits a frame of PCM audio to the audio output device.

Parameters
bufInterleaved sample data (stereo: L,R,… or surround: FL,FR,C,LFE,SL,SR,…).
lenLength of buf in bytes.

◆ AudioSetAudioComponent()

void AudioSetAudioComponent ( std::shared_ptr< Ship::Audio audio)

◆ GetAudioChannels()

API_EXPORT AudioChannelsSetting GetAudioChannels ( )

Returns the current audio channel mode (stereo / 5.1 matrix / 5.1 raw).

◆ GetNumAudioChannels()

API_EXPORT int32_t GetNumAudioChannels ( )

Returns the number of output channels active on the current audio device (2 or 6).

◆ SetAudioChannels()

API_EXPORT void SetAudioChannels ( AudioChannelsSetting  channels)

Changes the audio channel configuration at runtime.

Reinitialises the audio backend with the new channel mode without requiring a game restart. Stereo and 5.1 surround (matrix or raw) are supported.

Parameters
channelsNew channel mode to apply.