VMUPro SDK v1.0.0
Application Development SDK for the VMUPro
Loading...
Searching...
No Matches
vmupro_audio.h File Reference

VMUPro SDK Audio API. More...

#include <stdint.h>
#include <stdbool.h>

Go to the source code of this file.

Typedefs

typedef int16_t vmupro_audio_sample_t
 Audio sample format.
 

Enumerations

enum  vmupro_stereo_mode_t { VMUPRO_AUDIO_MONO = 0 , VMUPRO_AUDIO_STEREO = 1 }
 Audio stereo mode enumeration. More...
 

Functions

bool vmupro_audio_start_listen_mode (void)
 
void vmupro_audio_exit_listen_mode (void)
 Exit audio listen mode.
 
void vmupro_audio_add_stream_samples (int16_t *samples, int numSamples, vmupro_stereo_mode_t stereo_mode, bool applyGlobalVolume)
 
void vmupro_audio_clear_ring_buffer (void)
 
uint8_t vmupro_get_global_volume (void)
 
void vmupro_set_global_volume (uint8_t volume)
 
int vmupro_get_ringbuffer_fill_state (uint32_t *outBufferFilledSamples, uint32_t *outBufferSizeInsamples)
 Return the fill state of the audio buffer either for internal or USB/BT audio.
 

Detailed Description

VMUPro SDK Audio API.

This header provides audio functionality for the VMUPro device.

Note
Currently only supports 44.1kHz mono audio
Audio functions are designed for real-time audio streaming
Author
8BitMods
Version
1.0.0
Date
2025-07-01

Definition in file vmupro_audio.h.

Typedef Documentation

◆ vmupro_audio_sample_t

typedef int16_t vmupro_audio_sample_t

Audio sample format.

Currently only 16-bit signed samples are supported.

Examples
/home/runner/work/vmupro-sdk/vmupro-sdk/sdk/include/vmupro_audio.h.

Definition at line 30 of file vmupro_audio.h.

Enumeration Type Documentation

◆ vmupro_stereo_mode_t

Audio stereo mode enumeration.

Specifies whether audio samples are mono or stereo.

Enumerator
VMUPRO_AUDIO_MONO 

Mono audio (single channel)

VMUPRO_AUDIO_STEREO 

Stereo audio (dual channel)

Examples
/home/runner/work/vmupro-sdk/vmupro-sdk/sdk/include/vmupro_audio.h.

Definition at line 37 of file vmupro_audio.h.

Function Documentation

◆ vmupro_audio_add_stream_samples()

void vmupro_audio_add_stream_samples ( int16_t *  samples,
int  numSamples,
vmupro_stereo_mode_t  stereo_mode,
bool  applyGlobalVolume 
)

◆ vmupro_audio_clear_ring_buffer()

void vmupro_audio_clear_ring_buffer ( void  )

◆ vmupro_audio_exit_listen_mode()

void vmupro_audio_exit_listen_mode ( void  )

Exit audio listen mode.

Stops audio streaming mode and releases audio resources. Should be called when audio streaming is no longer needed.

Note
This will stop any ongoing audio playback
Must be called after vmupro_audio_start_listen_mode() to clean up resources
Examples
/home/runner/work/vmupro-sdk/vmupro-sdk/sdk/include/vmupro_audio.h.

◆ vmupro_audio_start_listen_mode()

bool vmupro_audio_start_listen_mode ( void  )

◆ vmupro_get_global_volume()

uint8_t vmupro_get_global_volume ( void  )

◆ vmupro_get_ringbuffer_fill_state()

int vmupro_get_ringbuffer_fill_state ( uint32_t *  outBufferFilledSamples,
uint32_t *  outBufferSizeInsamples 
)

Return the fill state of the audio buffer either for internal or USB/BT audio.

Parameters
outBufferFilledsamplesHow many samples are sat in the ring buffer waiting to be sent to the audio device
outBufferSizeInSamplesHow big is the buffer in samples E.g. a 16kb buffer can hold 8k 16-bit mono samples or 8k 16-bit stereo samples Free space is the difference: max size - filled bytes
Returns
Fill percent 0-100%
Note
A full buffer may be slightly laggy, while running it close to empty will provide lower latency (running the risk of audio gaps if you code is slow)
Examples
/home/runner/work/vmupro-sdk/vmupro-sdk/sdk/include/vmupro_audio.h.

◆ vmupro_set_global_volume()

void vmupro_set_global_volume ( uint8_t  volume)