Skip to content
This repository was archived by the owner on Mar 26, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions api/iOS/VCSimpleSession.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ typedef NS_ENUM(NSInteger, VCFilter) {

- (void) endRtmpSession;

- (void) setAudioBitRate:(float)bitRate;

- (void) getCameraPreviewLayer: (AVCaptureVideoPreviewLayer**) previewLayer;

/*!
Expand Down
13 changes: 13 additions & 0 deletions api/iOS/VCSimpleSession.mm
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ @interface VCSimpleSession()
float _videoZoomFactor;
int _audioChannelCount;
float _audioSampleRate;
float _audioBitRate;
float _micGain;

VCCameraState _cameraState;
Expand Down Expand Up @@ -329,6 +330,18 @@ - (void) setMicGain:(float)micGain
_micGain = micGain;
}
}
- (void)
setAudioBitRate:(float)bitRate
{
if(m_audioMixer) {
m_audioMixer->setBitsPerChannel(bitRate);
}
}
- (float)
audioBitRate
{
return _audioBitRate;
}
- (float) micGain
{
return _micGain;
Expand Down
6 changes: 5 additions & 1 deletion mixers/GenericAudioMixer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,11 @@ namespace videocore {
{
m_outFrequencyInHz = frequencyInHz;
}

void
GenericAudioMixer::setBitsPerChannel(float bitRate)
{
m_outBitsPerChannel = bitRate;
}
void
GenericAudioMixer::mixThread()
{
Expand Down
3 changes: 3 additions & 0 deletions mixers/GenericAudioMixer.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ namespace videocore {

/*! IAudioMixer::setFrequencyInHz */
void setFrequencyInHz(float frequencyInHz);

/*! IAudioMixer::setBitsPerChannel */
void setBitsPerChannel(float bitRate);

/*! IAudioMixer::setMinimumBufferDuration */
virtual void setMinimumBufferDuration(const double duration) ;
Expand Down
9 changes: 8 additions & 1 deletion mixers/IAudioMixer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,14 @@ namespace videocore {
* \param frequencyInHz The audio sample frequency in Hz.
*/
virtual void setFrequencyInHz(float frequencyInHz) = 0;


/*!
* Set the bits ber channel count.
*
* \param frequencyInHz The audio bit rate.
*/
virtual void setBitsPerChannel(float bitRate) = 0;

/*!
* Set the amount of time to buffer before emitting mixed samples.
*
Expand Down