mirror of
https://github.com/AxioDL/boo.git
synced 2025-12-09 13:37:48 +00:00
Add API for reporting submix sample rate and format
This commit is contained in:
@@ -178,4 +178,23 @@ const AudioVoiceEngineMixInfo& AudioSubmix::mixInfo() const
|
||||
return m_parent.mixInfo();
|
||||
}
|
||||
|
||||
double AudioSubmix::getSampleRate() const
|
||||
{
|
||||
return mixInfo().m_sampleRate;
|
||||
}
|
||||
|
||||
SubmixFormat AudioSubmix::getSampleFormat() const
|
||||
{
|
||||
switch (mixInfo().m_sampleFormat)
|
||||
{
|
||||
case SOXR_INT16_I:
|
||||
default:
|
||||
return SubmixFormat::Int16;
|
||||
case SOXR_INT32_I:
|
||||
return SubmixFormat::Int32;
|
||||
case SOXR_FLOAT32_I:
|
||||
return SubmixFormat::Float;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -61,12 +61,11 @@ public:
|
||||
bool dynamicPitch=false);
|
||||
|
||||
std::unique_ptr<IAudioSubmix> allocateNewSubmix(IAudioSubmixCallback* cb=nullptr);
|
||||
|
||||
void setChannelGains(const float gains[8]);
|
||||
|
||||
void unbindSubmix();
|
||||
|
||||
const AudioVoiceEngineMixInfo& mixInfo() const;
|
||||
double getSampleRate() const;
|
||||
SubmixFormat getSampleFormat() const;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user