Skip to content

Commit

Permalink
fix(Android): num channels & sample rate are not applied in AAC format.
Browse files Browse the repository at this point in the history
fix #289
  • Loading branch information
llfbandit committed Mar 3, 2024
1 parent d289492 commit 8e06a9e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions record_android/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 1.0.5
* fix: num channels & sample rate are not applied in AAC format.

## 1.0.4
* fix: AAC duration can not be obtained.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ class AacFormat : Format() {
override fun getMediaFormat(config: RecordConfig): MediaFormat {
val format = MediaFormat().apply {
setString(MediaFormat.KEY_MIME, mimeTypeAudio)
setInteger(MediaFormat.KEY_SAMPLE_RATE, nearestValue(sampleRates, sampleRate))
setInteger(MediaFormat.KEY_CHANNEL_COUNT, numChannels)
setInteger(MediaFormat.KEY_SAMPLE_RATE, nearestValue(sampleRates, config.sampleRate))
setInteger(MediaFormat.KEY_CHANNEL_COUNT, config.numChannels)
setInteger(MediaFormat.KEY_BIT_RATE, config.bitRate)

// Specifics
Expand Down

0 comments on commit 8e06a9e

Please sign in to comment.