Audaspace 1.5.0
A high level audio library.
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
Mixer Class Reference

This abstract class is able to mix audiosignals with same channel count and sample rate and convert it to a specific output format. More...

#include <Mixer.h>

Public Member Functions

 Mixer (DeviceSpecs specs)
 Creates the mixer.
 
virtual ~Mixer ()
 Destroys the mixer.
 
DeviceSpecs getSpecs () const
 Returns the target specification for superposing.
 
void setSpecs (Specs specs)
 Sets the target specification for superposing.
 
void setSpecs (DeviceSpecs specs)
 Sets the target specification for superposing.
 
void mix (sample_t *buffer, int start, int length, float volume)
 Mixes a buffer.
 
void mix (sample_t *buffer, int start, int length, float volume_to, float volume_from)
 Mixes a buffer with linear volume interpolation.
 
void read (data_t *buffer, float volume)
 Writes the mixing buffer into an output buffer.
 
void clear (int length)
 Clears the mixing buffer.
 

Protected Attributes

DeviceSpecs m_specs
 The output specification.
 
int m_length
 The length of the mixing buffer.
 
Buffer m_buffer
 The mixing buffer.
 
convert_f m_convert
 Converter function.
 

Detailed Description

This abstract class is able to mix audiosignals with same channel count and sample rate and convert it to a specific output format.

Member Function Documentation

◆ clear()

void Mixer::clear ( int length)

Clears the mixing buffer.

Parameters
lengthThe length of the buffer in samples.

◆ getSpecs()

DeviceSpecs Mixer::getSpecs ( ) const

Returns the target specification for superposing.

Returns
The target specification.

◆ mix() [1/2]

void Mixer::mix ( sample_t * buffer,
int start,
int length,
float volume )

Mixes a buffer.

Parameters
bufferThe buffer to superpose.
startThe start sample of the buffer.
lengthThe length of the buffer in samples.
volumeThe mixing volume. Must be a value between 0.0 and 1.0.

◆ mix() [2/2]

void Mixer::mix ( sample_t * buffer,
int start,
int length,
float volume_to,
float volume_from )

Mixes a buffer with linear volume interpolation.

Parameters
bufferThe buffer to superpose.
startThe start sample of the buffer.
lengthThe length of the buffer in samples.
volume_toThe target mixing volume. Must be a value between 0.0 and 1.0.
volume_fromThe start mixing volume. Must be a value between 0.0 and 1.0.

◆ read()

void Mixer::read ( data_t * buffer,
float volume )

Writes the mixing buffer into an output buffer.

Parameters
bufferThe target buffer for superposing.
volumeThe mixing volume. Must be a value between 0.0 and 1.0.

◆ setSpecs() [1/2]

void Mixer::setSpecs ( DeviceSpecs specs)

Sets the target specification for superposing.

Parameters
specsThe target specification.

◆ setSpecs() [2/2]

void Mixer::setSpecs ( Specs specs)

Sets the target specification for superposing.

Parameters
specsThe target specification.

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