Skip to content

Commit

Permalink
Merge branch 'better-recording' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
pserwylo committed Mar 13, 2022
2 parents ed101e7 + 88777c5 commit 46bc6ab
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,8 @@
.cxx
local.properties

# Build
app/release

# Used for working files such as raw audio, audacity projects, etc.
/scratch
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ android {
applicationId "com.serwylo.babyphone"
minSdkVersion 26
targetSdkVersion 31
versionCode 9
versionName "1.0.0"
versionCode 10
versionName "1.0.1"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

Expand Down
Binary file removed app/release/app-release.aab
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,21 @@ class EditContactViewModel(

withContext(Dispatchers.Main) { _isRecording.value = true }

File(contactDir, "${Date().time}.${Math.random() * 10000000}.3gp").also { soundFile ->
File(contactDir, "${Date().time}.${Math.random() * 10000000}.aac").also { soundFile ->
currentlyRecordingSound = soundFile

recorder = MediaRecorder().apply {
// Tried using AudioSource.VOICE_RECOGNITION - but the sound cancelation provided
// ends up sounding tinny and robotic.
setAudioSource(MediaRecorder.AudioSource.MIC)
setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP)

setOutputFormat(MediaRecorder.OutputFormat.MPEG_4)

// Nice high quality settings for voice recording.
setAudioEncodingBitRate(128000)
setAudioSamplingRate(44100)
setOutputFile(soundFile)
setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB)
setAudioEncoder(MediaRecorder.AudioEncoder.AAC)

prepare()
start()
Expand Down
5 changes: 5 additions & 0 deletions fastlane/metadata/android/en-US/changelogs/10.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Better quality audio recording.

Less fuzzy, clean and crisp sounds. Only applies to new recordings, so you may wish to re-record any previosu sounds.

Please donate to support further development.

0 comments on commit 46bc6ab

Please sign in to comment.