File tree Expand file tree Collapse file tree 4 files changed +9
-8
lines changed
src/main/java/com/github/squti/androidwaverecorder Expand file tree Collapse file tree 4 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -24,12 +24,12 @@ android {
24
24
25
25
dependencies {
26
26
implementation fileTree(dir : ' libs' , include : [' *.jar' ])
27
- implementation " org.jetbrains.kotlin:kotlin-stdlib-jdk7:$k otlin_version "
27
+ implementation ' org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.31 '
28
28
implementation ' androidx.appcompat:appcompat:1.1.0'
29
- implementation ' androidx.core:core-ktx:1.1 .0'
29
+ implementation ' androidx.core:core-ktx:1.7 .0'
30
30
testImplementation ' junit:junit:4.12'
31
31
androidTestImplementation ' androidx.test.ext:junit:1.1.1'
32
32
androidTestImplementation ' androidx.test.espresso:espresso-core:3.2.0'
33
- implementation ' org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3 .2'
34
- implementation ' org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3 .2'
33
+ implementation ' org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5 .2'
34
+ implementation ' org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5 .2'
35
35
}
Original file line number Diff line number Diff line change 24
24
25
25
package com.github.squti.androidwaverecorder
26
26
27
+ import android.annotation.SuppressLint
27
28
import android.media.AudioRecord
28
29
import android.media.MediaRecorder
29
30
import android.media.audiofx.NoiseSuppressor
@@ -84,6 +85,7 @@ class WaveRecorder(private var filePath: String) {
84
85
/* *
85
86
* Starts audio recording asynchronously and writes recorded data chunks on storage.
86
87
*/
88
+ @SuppressLint(" MissingPermission" )
87
89
fun startRecording () {
88
90
89
91
if (! isAudioRecorderInitialized()) {
@@ -157,7 +159,7 @@ class WaveRecorder(private var filePath: String) {
157
159
ByteBuffer .wrap(data).order(ByteOrder .LITTLE_ENDIAN ).asShortBuffer()
158
160
.get(shortData)
159
161
160
- return shortData.max ()?.toInt() ? : 0
162
+ return shortData.maxOrNull ()?.toInt() ? : 0
161
163
}
162
164
163
165
/* * Changes @property filePath to @param newFilePath
Original file line number Diff line number Diff line change 1
1
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2
2
3
3
buildscript {
4
- ext. kotlin_version = ' 1.3.50'
5
4
repositories {
6
5
google()
7
6
jcenter()
8
7
9
8
}
10
9
dependencies {
11
10
classpath ' com.android.tools.build:gradle:7.1.3'
12
- classpath " org.jetbrains.kotlin:kotlin-gradle-plugin:$k otlin_version "
11
+ classpath ' org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31 '
13
12
// NOTE: Do not place your application dependencies here; they belong
14
13
// in the individual module build.gradle files
15
14
}
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ android {
24
24
25
25
dependencies {
26
26
implementation fileTree(dir : ' libs' , include : [' *.jar' ])
27
- implementation " org.jetbrains.kotlin:kotlin-stdlib-jdk7:$k otlin_version "
27
+ implementation ' org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.31 '
28
28
implementation ' androidx.appcompat:appcompat:1.1.0'
29
29
implementation ' androidx.core:core-ktx:1.1.0'
30
30
implementation ' androidx.constraintlayout:constraintlayout:1.1.3'
You can’t perform that action at this time.
0 commit comments