Skip to content

Commit

Permalink
Updated JavaDoc for all files
Browse files Browse the repository at this point in the history
  • Loading branch information
gkonovalov committed Jan 10, 2024
1 parent c1c148e commit ad98ff5
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 36 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:8.2.0'
classpath 'com.android.tools.build:gradle:8.2.1'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.21'
}
}
Expand Down
2 changes: 1 addition & 1 deletion example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ android {
compileSdk 34
minSdkVersion 23
targetSdkVersion 34
versionCode 13
versionCode 14
versionName "2.0.6"

setProperty("archivesBaseName", "Android-VAD-v" + versionName)
Expand Down
2 changes: 1 addition & 1 deletion silero/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ android {
compileSdk 34
minSdkVersion 21
targetSdkVersion 34
versionCode 13
versionCode 14
versionName "2.0.6"

setProperty("archivesBaseName", "android-vad-silero-v" + versionName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ import org.junit.runner.RunWith

/**
* Created by Georgiy Konovalov on 12/22/2023.
* <p>
*
* Instrumented test for VadSilero class.
* </p>
*/
@RunWith(AndroidJUnit4::class)
class VadSileroTest {
Expand Down
40 changes: 17 additions & 23 deletions utils/src/main/java/com/konovalov/vad/utils/AudioUtils.kt
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
package com.konovalov.vad.utils

/**
* Created by Georgiy Konovalov on 18/07/2023.
* <p>
* Created by Georgiy Konovalov on 7/18/2023.
*
* AudioUtils is a utility class that provides various functions to work with audio data
* in different formats. It contains static methods that facilitate audio data conversions,
* processing, and manipulation. This class aims to simplify common audio-related tasks
* and ensure reusability of audio processing logic across the application.
* </p>
*/
object AudioUtils {

/**
* <p>
* Convert audio data from ShortArray to FloatArray.
* </p>
* @param audio: ShortArray - audio data for conversion.
* @return Converted audio data as FloatArray.
*
* @param audio is audio data for conversion.
* @return converted audio data as FloatArray.
*/
fun toFloatArray(audio: ShortArray): FloatArray {
return FloatArray(audio.size) { i ->
Expand All @@ -25,11 +23,10 @@ object AudioUtils {
}

/**
* <p>
* Convert audio data from ByteArray to FloatArray.
* </p>
* @param audio: ByteArray - audio data for conversion.
* @return Converted audio data as FloatArray.
*
* @param audio is audio data for conversion.
* @return converted audio data as FloatArray.
*/
fun toFloatArray(audio: ByteArray): FloatArray {
return FloatArray(audio.size / 2) { i ->
Expand All @@ -38,11 +35,10 @@ object AudioUtils {
}

/**
* <p>
* Convert audio data from FloatArray to ShortArray.
* </p>
* @param audio: FloatArray - audio data for conversion.
* @return Converted audio data as ShortArray.
*
* @param audio is audio data for conversion.
* @return converted audio data as ShortArray.
*/
fun toShortArray(audio: FloatArray): ShortArray {
return ShortArray(audio.size) { i ->
Expand All @@ -51,11 +47,10 @@ object AudioUtils {
}

/**
* <p>
* Convert audio data from ByteArray to ShortArray.
* </p>
* @param audio: ByteArray - audio data for conversion.
* @return Converted audio data as ShortArray.
*
* @param audio is audio data for conversion.
* @return converted audio data as ShortArray.
*/
fun toShortArray(audio: ByteArray): ShortArray {
return ShortArray(audio.size / 2) { i ->
Expand All @@ -64,12 +59,11 @@ object AudioUtils {
}

/**
* <p>
* Calculates the frame count based on the duration in milliseconds,
* frequency and frame size.
* </p>
* @param durationMs The duration in milliseconds.
* @return The frame count.
*
* @param durationMs duration in milliseconds.
* @return frame count.
*/
fun getFramesCount(sampleRate: Int, frameSize: Int, durationMs: Int): Int {
return durationMs / (frameSize / (sampleRate / 1000))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ import org.junit.Test

/**
* Created by Georgiy Konovalov on 12/04/2023.
* <p>
*
* Unit tests for AudioUtils class.
* </p>
*/
class AudioUtilsTest {

Expand Down
2 changes: 1 addition & 1 deletion webrtc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ android {
compileSdk 34
minSdkVersion 16
targetSdkVersion 34
versionCode 13
versionCode 14
versionName "2.0.6"

setProperty("archivesBaseName", "android-vad-webrtc-v" + versionName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ import org.junit.runner.RunWith

/**
* Created by Georgiy Konovalov on 12/22/2023.
* <p>
*
* Instrumented test for VadWebRTC class.
* </p>
*/
@RunWith(AndroidJUnit4::class)
class VadWebRTCTest {
Expand Down
2 changes: 1 addition & 1 deletion yamnet/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ android {
compileSdk 34
minSdkVersion 23
targetSdkVersion 34
versionCode 13
versionCode 14
versionName "2.0.6"

setProperty("archivesBaseName", "android-vad-yamnet-v" + versionName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ import org.junit.runner.RunWith

/**
* Created by Georgiy Konovalov on 12/22/2023.
* <p>
*
* Instrumented test for VadYamnet class.
* </p>
*/
@RunWith(AndroidJUnit4::class)
class VadYamnetTest {
Expand Down

0 comments on commit ad98ff5

Please sign in to comment.