GlistEngine
Loading...
Searching...
No Matches
gSoundRecorder Class Reference

A sound recorder class using miniaudio for microphone input capture. More...

#include <gSoundRecorder.h>

Inheritance diagram for gSoundRecorder:
Collaboration diagram for gSoundRecorder:

Public Types

enum  { RECORDQUALITY_LOW , RECORDQUALITY_MIDDLE , RECORDQUALITY_HIGH , RECORDQUALITY_ULTRA }
 

Public Member Functions

 gSoundRecorder ()
 
virtual ~gSoundRecorder ()
 
void startRecording (const std::string &filepath, int quality=RECORDQUALITY_MIDDLE)
 Starts recording and saves microphone input to a file.
 
void startRecordingSound (const std::string &filename, int quality=RECORDQUALITY_MIDDLE)
 Starts recording and saves into project's assets/sounds folder.
 
void stopRecording ()
 Stops recording and finalizes the output file.
 
bool isRecording ()
 Checks if recording is active.
 
bool setRecordingPaused (bool recordingPaused)
 Pauses or resumes the recording process.
 
bool isRecordingPaused ()
 Checks if recording is currently paused.
 
- Public Member Functions inherited from gObject
 gObject ()
 
void logi (std::string message)
 
void logd (std::string message)
 
void logw (std::string message)
 
void loge (std::string message)
 
void logi (std::string tag, std::string message)
 
void logd (std::string tag, std::string message)
 
void logw (std::string tag, std::string message)
 
void loge (std::string tag, std::string message)
 

Additional Inherited Members

- Static Public Member Functions inherited from gObject
static std::string gGetAppDir ()
 
static std::string gGetAssetsDir ()
 
static void gSetAssetsDir (std::string assetsDir)
 
static std::string gGetFilesDir ()
 
static std::string gGetImagesDir ()
 
static std::string gGetFontsDir ()
 
static std::string gGetModelsDir ()
 
static std::string gGetTexturesDir ()
 
static std::string gGetShadersDir ()
 
static std::string gGetSoundsDir ()
 
static std::string gGetDatabasesDir ()
 
static std::string gGetVideosDir ()
 
static void setCurrentResolution (int scalingNo, int currentResolutionNo)
 
- Static Public Attributes inherited from gObject
static const int LOGLEVEL_SILENT
 
static const int LOGLEVEL_DEBUG
 
static const int LOGLEVEL_INFO
 
static const int LOGLEVEL_WARNING
 
static const int LOGLEVEL_ERROR
 
- Static Protected Attributes inherited from gObject
static int renderpassnum
 
static int renderpassno
 
static int releasescaling
 
static int releaseresolution
 

Detailed Description

A sound recorder class using miniaudio for microphone input capture.

This class records audio from the default input device and writes it to a file using ma_device and ma_encoder. Recording can be started, paused, resumed, and stopped. Quality presets control the audio fidelity and file size.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
RECORDQUALITY_LOW 
RECORDQUALITY_MIDDLE 
RECORDQUALITY_HIGH 
RECORDQUALITY_ULTRA 

Constructor & Destructor Documentation

◆ gSoundRecorder()

gSoundRecorder::gSoundRecorder ( )

◆ ~gSoundRecorder()

virtual gSoundRecorder::~gSoundRecorder ( )
virtual

Member Function Documentation

◆ isRecording()

bool gSoundRecorder::isRecording ( )

Checks if recording is active.

Returns
True if recording, false otherwise.

◆ isRecordingPaused()

bool gSoundRecorder::isRecordingPaused ( )

Checks if recording is currently paused.

Returns
True if paused, false otherwise.

◆ setRecordingPaused()

bool gSoundRecorder::setRecordingPaused ( bool  recordingPaused)

Pauses or resumes the recording process.

Parameters
recordingPausedTrue to pause, false to resume.
Returns
Current pause state.

◆ startRecording()

void gSoundRecorder::startRecording ( const std::string &  filepath,
int  quality = RECORDQUALITY_MIDDLE 
)

Starts recording and saves microphone input to a file.

Parameters
filepathFull path of the output file.
qualityRecording quality preset.

◆ startRecordingSound()

void gSoundRecorder::startRecordingSound ( const std::string &  filename,
int  quality = RECORDQUALITY_MIDDLE 
)

Starts recording and saves into project's assets/sounds folder.

Parameters
filenameRelative path of the output file.
qualityRecording quality preset.

◆ stopRecording()

void gSoundRecorder::stopRecording ( )

Stops recording and finalizes the output file.


The documentation for this class was generated from the following file: