Babel  1
The voip software that only works on your local network
Loading...
Searching...
No Matches
PortAudio Class Reference

Class for handling audio playback and recording using PortAudio. More...

#include <Audio.hpp>

Collaboration diagram for PortAudio:
Collaboration graph

Public Member Functions

 PortAudio ()
 Construct a new PortAudio object.
 
 ~PortAudio ()
 Destroy the PortAudio object.
 
void play ()
 Start audio playback.
 
void stopPlay ()
 Stop audio playback.
 
void record ()
 Start audio recording.
 
void stopRecord ()
 Stop audio recording.
 
bool getSound (std::vector< float > &soundVector, int packetSize)
 Get recorded sound data.
 
void setPlaySound (const std::vector< float > &soundVector)
 Set the sound data to be played.
 
void resetBuffers ()
 Reset the input and output buffers.
 

Detailed Description

Class for handling audio playback and recording using PortAudio.

Definition at line 29 of file Audio.hpp.

Constructor & Destructor Documentation

◆ PortAudio()

PortAudio::PortAudio ( )

Construct a new PortAudio object.

Definition at line 18 of file Audio.cpp.

◆ ~PortAudio()

PortAudio::~PortAudio ( )

Destroy the PortAudio object.

Definition at line 31 of file Audio.cpp.

Member Function Documentation

◆ getSound()

bool PortAudio::getSound ( std::vector< float > & soundVector,
int packetSize )

Get recorded sound data.

Gets the recorded sound.

Parameters
soundVectorVector to store the sound data.
packetSizeSize of the packet to retrieve.
Returns
true if sound data was retrieved successfully.
false otherwise.
Parameters
soundVectorThe vector to store the recorded sound.
packetSizeThe size of the packet to retrieve.
Returns
True if the sound was successfully retrieved, false otherwise.

Definition at line 164 of file Audio.cpp.

◆ play()

void PortAudio::play ( )

Start audio playback.

Starts playing the audio.

Definition at line 106 of file Audio.cpp.

◆ record()

void PortAudio::record ( )

Start audio recording.

Starts recording the audio.

Definition at line 133 of file Audio.cpp.

◆ resetBuffers()

void PortAudio::resetBuffers ( )

Reset the input and output buffers.

Resets the input and output buffers.

Definition at line 199 of file Audio.cpp.

◆ setPlaySound()

void PortAudio::setPlaySound ( const std::vector< float > & soundVector)

Set the sound data to be played.

Sets the sound to be played.

Parameters
soundVectorVector containing the sound data.
soundVectorThe vector containing the sound to be played.

Definition at line 185 of file Audio.cpp.

◆ stopPlay()

void PortAudio::stopPlay ( )

Stop audio playback.

Stops playing the audio.

Definition at line 120 of file Audio.cpp.

◆ stopRecord()

void PortAudio::stopRecord ( )

Stop audio recording.

Stops recording the audio.

Definition at line 147 of file Audio.cpp.


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