Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions include/padscore/wpad.h
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ struct WPADAddress
WUT_CHECK_OFFSET(WPADAddress, 0x00, btDeviceAddress);
WUT_CHECK_SIZE(WPADAddress, 0x6);

//! Continuation parameters for WENCGetEncodeData
//! Continuation parameters for \link WENCGetEncodeData
struct WENCParams
{
WUT_UNKNOWN_BYTES(32);
Expand Down Expand Up @@ -909,11 +909,12 @@ WPADSendStreamData(WPADChan channel,
* Encode 16-bit LPCM as 4-bit Yamaha ADPCM
* \param params encoding continuation params, written on first call, and read and updated on each subsequent call
* \param continuing should be TRUE if continuing encoding stream with the params produced via a prior call
* \param samples 16-bit LPCM sample buffer
* \param [in] samples 16-bit LPCM sample buffer
* \param sampleCount number of 16-bit LPCM samples
* \param outEncodedData buffer for the returned adpcm samples, buffer size should be equal to {(sampleCount + 1) / 2}
* \param [out] outEncodedData buffer for the returned ADPCM samples, size should be {(sampleCount + 1) / 2}
* \return Number of LPCM-16 samples
*
* \sa AXRmtGetSamples
* \sa WPADSendStreamData
*/
uint32_t
Expand Down
56 changes: 56 additions & 0 deletions include/sndcore2/rmt.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#pragma once

/**
* \defgroup sndcore2_rmt Remote
* \ingroup sndcore2
*
* @{
*/

#ifdef __cplusplus
extern "C" {
#endif
/**
* Consume samples for all Wiimotes
* \param count number of samples to consume
* \return number of samples actually consumed
*
* \see AXRmtGetSamplesLeft
* \see AXRmtGetSamples
* \note
* Reduces number of available samples
*/
uint32_t
AXRmtAdvancePtr(uint32_t count);

/**
* Gets 16-bit LPCM samples queued for a Wiimote
* \param index WPAD channel of the device (0 - 3)
* \param [out] samples 16-bit LPCM samples queued for specified device
* \param sampleCount requested number of samples
* \return actual number of 16-bit LPCM samples obtained
*
* \see WENCGetEncodeData
* \see AXRmtGetSamplesLeft
* \see AXRmtAdvancePtr
* \see AXSetVoiceRmtOn
* \note
* Samples can be obtained while a voice with remote output enabled is playing
*/
uint32_t
AXRmtGetSamples(uint32_t index, int16_t *samples, uint32_t sampleCount);

/**
* Get number of samples currently available to Wiimotes
* \return number of available samples
*
* \see AXRmtGetSamples
* \see AXRmtAdvancePtr
*/
uint32_t
AXRmtGetSamplesLeft();
#ifdef __cplusplus
}
#endif

/** @} */
10 changes: 10 additions & 0 deletions include/sndcore2/voice.h
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,16 @@ void
AXSetVoiceVeDelta(AXVoice *voice,
int16_t delta);

/**
* Enable generating samples for Wiimotes
* \param voice voice to generate samples from
* \param on set TRUE to generate samples for Wiimotes
*
* \see AXRmtGetSamples
*/
void
AXSetVoiceRmtOn(AXVoice *voice, uint16_t on);

#ifdef __cplusplus
}
#endif
Expand Down