Skip to content

Commit 13d9df9

Browse files
adding setting of audio parameters
1 parent 23501f1 commit 13d9df9

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/AvTranscoder/DatasStructures/AudioDesc.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ void AudioDesc::setAudioCodec( const AVCodecID codecId )
4949
initCodecContext();
5050
}
5151

52+
void AudioDesc::setAudioParameters( const size_t sampleRate, const size_t channels, const AVSampleFormat& sampleFormat )
53+
{
54+
m_codecContext->sample_rate = sampleRate;
55+
m_codecContext->channels = channels;
56+
m_codecContext->sample_fmt = sampleFormat;
57+
}
58+
5259
void AudioDesc::initCodecContext( )
5360
{
5461
if( m_codec == NULL )

src/AvTranscoder/DatasStructures/AudioDesc.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ class AvExport AudioDesc
2727
void setAudioCodec( const std::string& codecName );
2828
void setAudioCodec( const AVCodecID codecId );
2929

30+
void setAudioParameters( const size_t sampleRate, const size_t channels, const AVSampleFormat& sampleFormat );
31+
3032
void set( const std::string& key, const std::string& flag, const bool enable );
3133
void set( const std::string& key, const bool value );
3234
void set( const std::string& key, const int value );

0 commit comments

Comments
 (0)