Doly C++ SDK v1.00
Loading...
Searching...
No Matches
SoundControl.h File Reference

Public API for Doly sound playback control. More...

#include "SoundEvent.h"

Go to the source code of this file.

Namespaces

namespace  SoundControl

Enumerations

enum class  SoundState : uint8_t { SET , STOP , PLAY }
 Sound activity state. More...

Functions

int8_t SoundControl::init ()
 Initialize sound control.
int8_t SoundControl::dispose ()
 Dispose/stop the sound subsystem and release resources.
int8_t SoundControl::play (std::string file_name, uint16_t id)
 Start playing a sound file (non-blocking).
void SoundControl::Abort ()
 Abort the currently playing sound (if any).
SoundState SoundControl::getState ()
 Get current sound playback state.
bool SoundControl::isActive ()
 Check whether the sound subsystem is active (initialized).
int8_t SoundControl::setVolume (uint8_t volume)
 Set playback volume as a percentage.
float SoundControl::getVersion ()
 Get current library version.

Detailed Description

Public API for Doly sound playback control.

This API provides non-blocking sound playback using an internal worker thread. Playback lifecycle events (begin/complete/abort/error) can be observed via SoundEvent.

Supported audio format (as required by the implementation):

  • File: WAV
  • Sample format: S16
  • Channels: 2 (stereo)
  • Sample rate: 48000 Hz

Design notes:

  • Singleton-style control (namespace API; no instances)
  • init() must be called before play()
  • play() is non-blocking (handled in another thread)

Enumeration Type Documentation

◆ SoundState

enum class SoundState : uint8_t
strong

Sound activity state.

Enumerator
SET 
STOP 
PLAY