Skip to content

Commit

Permalink
Update Kotlin version
Browse files Browse the repository at this point in the history
  • Loading branch information
squti committed Apr 12, 2022
1 parent 8a0b938 commit a4e4697
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
8 changes: 4 additions & 4 deletions android-wave-recorder/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ android {

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.31'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core-ktx:1.1.0'
implementation 'androidx.core:core-ktx:1.7.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.2'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.2'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2'
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

package com.github.squti.androidwaverecorder

import android.annotation.SuppressLint
import android.media.AudioRecord
import android.media.MediaRecorder
import android.media.audiofx.NoiseSuppressor
Expand Down Expand Up @@ -84,6 +85,7 @@ class WaveRecorder(private var filePath: String) {
/**
* Starts audio recording asynchronously and writes recorded data chunks on storage.
*/
@SuppressLint("MissingPermission")
fun startRecording() {

if (!isAudioRecorderInitialized()) {
Expand Down Expand Up @@ -157,7 +159,7 @@ class WaveRecorder(private var filePath: String) {
ByteBuffer.wrap(data).order(ByteOrder.LITTLE_ENDIAN).asShortBuffer()
.get(shortData)

return shortData.max()?.toInt() ?: 0
return shortData.maxOrNull()?.toInt() ?: 0
}

/** Changes @property filePath to @param newFilePath
Expand Down
3 changes: 1 addition & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.3.50'
repositories {
google()
jcenter()

}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down
2 changes: 1 addition & 1 deletion sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ android {

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.31'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core-ktx:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
Expand Down

0 comments on commit a4e4697

Please sign in to comment.