diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..eaf91e2 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..9e88da7 --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +ProMusic \ No newline at end of file diff --git a/.idea/appInsightsSettings.xml b/.idea/appInsightsSettings.xml new file mode 100644 index 0000000..fd8246c --- /dev/null +++ b/.idea/appInsightsSettings.xml @@ -0,0 +1,26 @@ + + + + + + \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..8fabff5 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml new file mode 100644 index 0000000..9a986ae --- /dev/null +++ b/.idea/deploymentTargetDropDown.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..0b0534c --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,19 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml new file mode 100644 index 0000000..5493a6c --- /dev/null +++ b/.idea/kotlinc.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/migrations.xml b/.idea/migrations.xml new file mode 100644 index 0000000..48052b2 --- /dev/null +++ b/.idea/migrations.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..8978d23 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/app/build.gradle.kts b/app/build.gradle.kts new file mode 100644 index 0000000..dc8e03d --- /dev/null +++ b/app/build.gradle.kts @@ -0,0 +1,67 @@ +plugins { + id("com.android.application") + id("org.jetbrains.kotlin.android") + id("kotlin-kapt") +} + +android { + namespace = "com.kitobochi.softapp.task.noisetimber" + compileSdk = 34 + + defaultConfig { + applicationId = "com.offline.proMusic.player" + minSdk = 24 + targetSdk = 34 + versionCode = 1 + versionName = "1.0" + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + + setProperty("archivesBaseName", "Musicoo_${defaultConfig.versionName}(${defaultConfig.versionCode})") + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = "1.8" + } + buildFeatures { + viewBinding = true + buildConfig = true + } +} + +dependencies { + + + implementation("androidx.core:core-ktx:1.12.0") + implementation("androidx.appcompat:appcompat:1.6.1") + implementation("com.google.android.material:material:1.11.0") + implementation("androidx.constraintlayout:constraintlayout:2.1.4") + implementation("androidx.media3:media3-session:1.3.1") + testImplementation("junit:junit:4.13.2") + androidTestImplementation("androidx.test.ext:junit:1.1.5") + androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1") + implementation("com.github.bumptech.glide:glide:4.16.0") + implementation("androidx.room:room-ktx:2.6.1") + implementation("androidx.room:room-runtime:2.6.1") + //noinspection KaptUsageInsteadOfKsp + kapt("androidx.room:room-compiler:2.6.1") + implementation("com.geyifeng.immersionbar:immersionbar:3.2.2") + implementation("com.geyifeng.immersionbar:immersionbar-ktx:3.2.2") + implementation("com.github.lihangleo2:ShadowLayout:3.4.0") + + implementation(libs.androidx.media3.exoplayer) + implementation(libs.androidx.media3.ui) + implementation(libs.androidx.media3.common) + implementation(libs.androidx.lifecycle.livedata.ktx) + implementation(libs.androidx.lifecycle.viewmodel.ktx) +} \ No newline at end of file diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100644 index 0000000..cf50408 --- /dev/null +++ b/app/proguard-rules.pro @@ -0,0 +1,22 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile + diff --git a/app/src/androidTest/java/com/kitobochi/softapp/task/noisetimber/ExampleInstrumentedTest.kt b/app/src/androidTest/java/com/kitobochi/softapp/task/noisetimber/ExampleInstrumentedTest.kt new file mode 100644 index 0000000..773c5bf --- /dev/null +++ b/app/src/androidTest/java/com/kitobochi/softapp/task/noisetimber/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package com.kitobochi.softapp.task.noisetimber + +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.ext.junit.runners.AndroidJUnit4 + +import org.junit.Test +import org.junit.runner.RunWith + +import org.junit.Assert.* + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + assertEquals("com.kitobochi.softapp.task.noisetimber", appContext.packageName) + } +} \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..02045e2 --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/assets/Sound of instrument data/Boil water.mp3 b/app/src/main/assets/Sound of instrument data/Boil water.mp3 new file mode 100644 index 0000000..1a70485 Binary files /dev/null and b/app/src/main/assets/Sound of instrument data/Boil water.mp3 differ diff --git a/app/src/main/assets/Sound of instrument data/Bubble.mp3 b/app/src/main/assets/Sound of instrument data/Bubble.mp3 new file mode 100644 index 0000000..da41208 Binary files /dev/null and b/app/src/main/assets/Sound of instrument data/Bubble.mp3 differ diff --git a/app/src/main/assets/Sound of instrument data/Guitar sound.mp3 b/app/src/main/assets/Sound of instrument data/Guitar sound.mp3 new file mode 100644 index 0000000..eb73026 Binary files /dev/null and b/app/src/main/assets/Sound of instrument data/Guitar sound.mp3 differ diff --git a/app/src/main/assets/Sound of instrument data/Motorcycle.mp3 b/app/src/main/assets/Sound of instrument data/Motorcycle.mp3 new file mode 100644 index 0000000..fc67043 Binary files /dev/null and b/app/src/main/assets/Sound of instrument data/Motorcycle.mp3 differ diff --git a/app/src/main/assets/Sound of instrument data/Pencil.mp3 b/app/src/main/assets/Sound of instrument data/Pencil.mp3 new file mode 100644 index 0000000..d820c06 Binary files /dev/null and b/app/src/main/assets/Sound of instrument data/Pencil.mp3 differ diff --git a/app/src/main/assets/Sound of instrument data/Piano.mp3 b/app/src/main/assets/Sound of instrument data/Piano.mp3 new file mode 100644 index 0000000..907823a Binary files /dev/null and b/app/src/main/assets/Sound of instrument data/Piano.mp3 differ diff --git a/app/src/main/assets/Sound of instrument data/Sea breeze.mp3 b/app/src/main/assets/Sound of instrument data/Sea breeze.mp3 new file mode 100644 index 0000000..071c0f2 Binary files /dev/null and b/app/src/main/assets/Sound of instrument data/Sea breeze.mp3 differ diff --git a/app/src/main/assets/Sound of instrument data/Sheep eating grass.mp3 b/app/src/main/assets/Sound of instrument data/Sheep eating grass.mp3 new file mode 100644 index 0000000..d2cd5ee Binary files /dev/null and b/app/src/main/assets/Sound of instrument data/Sheep eating grass.mp3 differ diff --git a/app/src/main/assets/Sound of instrument data/The sound of mixing cup.mp3 b/app/src/main/assets/Sound of instrument data/The sound of mixing cup.mp3 new file mode 100644 index 0000000..0af9b46 Binary files /dev/null and b/app/src/main/assets/Sound of instrument data/The sound of mixing cup.mp3 differ diff --git a/app/src/main/assets/Sound of instrument/Boil water.png b/app/src/main/assets/Sound of instrument/Boil water.png new file mode 100644 index 0000000..57e3287 Binary files /dev/null and b/app/src/main/assets/Sound of instrument/Boil water.png differ diff --git a/app/src/main/assets/Sound of instrument/Bubble.png b/app/src/main/assets/Sound of instrument/Bubble.png new file mode 100644 index 0000000..5154916 Binary files /dev/null and b/app/src/main/assets/Sound of instrument/Bubble.png differ diff --git a/app/src/main/assets/Sound of instrument/Guitar sound.jpg b/app/src/main/assets/Sound of instrument/Guitar sound.jpg new file mode 100644 index 0000000..be1088d Binary files /dev/null and b/app/src/main/assets/Sound of instrument/Guitar sound.jpg differ diff --git a/app/src/main/assets/Sound of instrument/Motorcycle.png b/app/src/main/assets/Sound of instrument/Motorcycle.png new file mode 100644 index 0000000..5bb44dc Binary files /dev/null and b/app/src/main/assets/Sound of instrument/Motorcycle.png differ diff --git a/app/src/main/assets/Sound of instrument/Pencil.png b/app/src/main/assets/Sound of instrument/Pencil.png new file mode 100644 index 0000000..0b68f0d Binary files /dev/null and b/app/src/main/assets/Sound of instrument/Pencil.png differ diff --git a/app/src/main/assets/Sound of instrument/Piano.png b/app/src/main/assets/Sound of instrument/Piano.png new file mode 100644 index 0000000..6a52892 Binary files /dev/null and b/app/src/main/assets/Sound of instrument/Piano.png differ diff --git a/app/src/main/assets/Sound of instrument/Sea breeze.png b/app/src/main/assets/Sound of instrument/Sea breeze.png new file mode 100644 index 0000000..693efca Binary files /dev/null and b/app/src/main/assets/Sound of instrument/Sea breeze.png differ diff --git a/app/src/main/assets/Sound of instrument/Sheep eating grass.png b/app/src/main/assets/Sound of instrument/Sheep eating grass.png new file mode 100644 index 0000000..ca57da9 Binary files /dev/null and b/app/src/main/assets/Sound of instrument/Sheep eating grass.png differ diff --git a/app/src/main/assets/Sound of instrument/The sound of mixing cup.png b/app/src/main/assets/Sound of instrument/The sound of mixing cup.png new file mode 100644 index 0000000..bc61963 Binary files /dev/null and b/app/src/main/assets/Sound of instrument/The sound of mixing cup.png differ diff --git a/app/src/main/assets/Voice of Nature data/Birdsong.mp3 b/app/src/main/assets/Voice of Nature data/Birdsong.mp3 new file mode 100644 index 0000000..632867b Binary files /dev/null and b/app/src/main/assets/Voice of Nature data/Birdsong.mp3 differ diff --git a/app/src/main/assets/Voice of Nature data/Early morning.mp3 b/app/src/main/assets/Voice of Nature data/Early morning.mp3 new file mode 100644 index 0000000..da41208 Binary files /dev/null and b/app/src/main/assets/Voice of Nature data/Early morning.mp3 differ diff --git a/app/src/main/assets/Voice of Nature data/Frog croaking.mp3 b/app/src/main/assets/Voice of Nature data/Frog croaking.mp3 new file mode 100644 index 0000000..d12b4cf Binary files /dev/null and b/app/src/main/assets/Voice of Nature data/Frog croaking.mp3 differ diff --git a/app/src/main/assets/Voice of Nature data/High -speed stream.mp3 b/app/src/main/assets/Voice of Nature data/High -speed stream.mp3 new file mode 100644 index 0000000..df354c1 Binary files /dev/null and b/app/src/main/assets/Voice of Nature data/High -speed stream.mp3 differ diff --git a/app/src/main/assets/Voice of Nature data/Lightning Storm.mp3 b/app/src/main/assets/Voice of Nature data/Lightning Storm.mp3 new file mode 100644 index 0000000..0f3fcea Binary files /dev/null and b/app/src/main/assets/Voice of Nature data/Lightning Storm.mp3 differ diff --git a/app/src/main/assets/Voice of Nature data/Rain falls in the leaves.mp3 b/app/src/main/assets/Voice of Nature data/Rain falls in the leaves.mp3 new file mode 100644 index 0000000..93eca42 Binary files /dev/null and b/app/src/main/assets/Voice of Nature data/Rain falls in the leaves.mp3 differ diff --git a/app/src/main/assets/Voice of Nature data/Wind blow.mp3 b/app/src/main/assets/Voice of Nature data/Wind blow.mp3 new file mode 100644 index 0000000..305e67e Binary files /dev/null and b/app/src/main/assets/Voice of Nature data/Wind blow.mp3 differ diff --git a/app/src/main/assets/Voice of Nature/Birdsong.png b/app/src/main/assets/Voice of Nature/Birdsong.png new file mode 100644 index 0000000..f47b610 Binary files /dev/null and b/app/src/main/assets/Voice of Nature/Birdsong.png differ diff --git a/app/src/main/assets/Voice of Nature/Early morning.png b/app/src/main/assets/Voice of Nature/Early morning.png new file mode 100644 index 0000000..2fc5592 Binary files /dev/null and b/app/src/main/assets/Voice of Nature/Early morning.png differ diff --git a/app/src/main/assets/Voice of Nature/Frog croaking.png b/app/src/main/assets/Voice of Nature/Frog croaking.png new file mode 100644 index 0000000..16899c6 Binary files /dev/null and b/app/src/main/assets/Voice of Nature/Frog croaking.png differ diff --git a/app/src/main/assets/Voice of Nature/High -speed stream.jpg b/app/src/main/assets/Voice of Nature/High -speed stream.jpg new file mode 100644 index 0000000..cf47bd2 Binary files /dev/null and b/app/src/main/assets/Voice of Nature/High -speed stream.jpg differ diff --git a/app/src/main/assets/Voice of Nature/Lightning Storm.png b/app/src/main/assets/Voice of Nature/Lightning Storm.png new file mode 100644 index 0000000..b6054de Binary files /dev/null and b/app/src/main/assets/Voice of Nature/Lightning Storm.png differ diff --git a/app/src/main/assets/Voice of Nature/Rain falls in the leaves.png b/app/src/main/assets/Voice of Nature/Rain falls in the leaves.png new file mode 100644 index 0000000..f0699dc Binary files /dev/null and b/app/src/main/assets/Voice of Nature/Rain falls in the leaves.png differ diff --git a/app/src/main/assets/Voice of Nature/Wind blow.jpg b/app/src/main/assets/Voice of Nature/Wind blow.jpg new file mode 100644 index 0000000..ab123d3 Binary files /dev/null and b/app/src/main/assets/Voice of Nature/Wind blow.jpg differ diff --git a/app/src/main/assets/White noise data/Big Ben.mp3 b/app/src/main/assets/White noise data/Big Ben.mp3 new file mode 100644 index 0000000..28fe426 Binary files /dev/null and b/app/src/main/assets/White noise data/Big Ben.mp3 differ diff --git a/app/src/main/assets/White noise data/Hair Dryer.mp3 b/app/src/main/assets/White noise data/Hair Dryer.mp3 new file mode 100644 index 0000000..68c9613 Binary files /dev/null and b/app/src/main/assets/White noise data/Hair Dryer.mp3 differ diff --git a/app/src/main/assets/White noise data/Mechanical failure.mp3 b/app/src/main/assets/White noise data/Mechanical failure.mp3 new file mode 100644 index 0000000..c287e26 Binary files /dev/null and b/app/src/main/assets/White noise data/Mechanical failure.mp3 differ diff --git a/app/src/main/assets/White noise data/Peeling an apple.mp3 b/app/src/main/assets/White noise data/Peeling an apple.mp3 new file mode 100644 index 0000000..d2cd5ee Binary files /dev/null and b/app/src/main/assets/White noise data/Peeling an apple.mp3 differ diff --git a/app/src/main/assets/White noise data/Rhythm.mp3 b/app/src/main/assets/White noise data/Rhythm.mp3 new file mode 100644 index 0000000..6a6c371 Binary files /dev/null and b/app/src/main/assets/White noise data/Rhythm.mp3 differ diff --git a/app/src/main/assets/White noise data/Speed car.mp3 b/app/src/main/assets/White noise data/Speed car.mp3 new file mode 100644 index 0000000..1aafa72 Binary files /dev/null and b/app/src/main/assets/White noise data/Speed car.mp3 differ diff --git a/app/src/main/assets/White noise data/Type writer.mp3 b/app/src/main/assets/White noise data/Type writer.mp3 new file mode 100644 index 0000000..673b3a1 Binary files /dev/null and b/app/src/main/assets/White noise data/Type writer.mp3 differ diff --git a/app/src/main/assets/White noise data/Voltage wire.mp3 b/app/src/main/assets/White noise data/Voltage wire.mp3 new file mode 100644 index 0000000..e53ed7a Binary files /dev/null and b/app/src/main/assets/White noise data/Voltage wire.mp3 differ diff --git a/app/src/main/assets/White noise data/Wooden Door.mp3 b/app/src/main/assets/White noise data/Wooden Door.mp3 new file mode 100644 index 0000000..f977129 Binary files /dev/null and b/app/src/main/assets/White noise data/Wooden Door.mp3 differ diff --git a/app/src/main/assets/White noise/Big Ben.jpg b/app/src/main/assets/White noise/Big Ben.jpg new file mode 100644 index 0000000..90fd49d Binary files /dev/null and b/app/src/main/assets/White noise/Big Ben.jpg differ diff --git a/app/src/main/assets/White noise/Hair Dryer.png b/app/src/main/assets/White noise/Hair Dryer.png new file mode 100644 index 0000000..86c945f Binary files /dev/null and b/app/src/main/assets/White noise/Hair Dryer.png differ diff --git a/app/src/main/assets/White noise/Mechanical failure.png b/app/src/main/assets/White noise/Mechanical failure.png new file mode 100644 index 0000000..be569d1 Binary files /dev/null and b/app/src/main/assets/White noise/Mechanical failure.png differ diff --git a/app/src/main/assets/White noise/Peeling an apple.png b/app/src/main/assets/White noise/Peeling an apple.png new file mode 100644 index 0000000..b3d8594 Binary files /dev/null and b/app/src/main/assets/White noise/Peeling an apple.png differ diff --git a/app/src/main/assets/White noise/Rhythm.jpg b/app/src/main/assets/White noise/Rhythm.jpg new file mode 100644 index 0000000..aceddff Binary files /dev/null and b/app/src/main/assets/White noise/Rhythm.jpg differ diff --git a/app/src/main/assets/White noise/Speed car.png b/app/src/main/assets/White noise/Speed car.png new file mode 100644 index 0000000..c727b27 Binary files /dev/null and b/app/src/main/assets/White noise/Speed car.png differ diff --git a/app/src/main/assets/White noise/Type writer.png b/app/src/main/assets/White noise/Type writer.png new file mode 100644 index 0000000..7386783 Binary files /dev/null and b/app/src/main/assets/White noise/Type writer.png differ diff --git a/app/src/main/assets/White noise/Voltage wire.jpg b/app/src/main/assets/White noise/Voltage wire.jpg new file mode 100644 index 0000000..597a474 Binary files /dev/null and b/app/src/main/assets/White noise/Voltage wire.jpg differ diff --git a/app/src/main/assets/White noise/Wooden Door.png b/app/src/main/assets/White noise/Wooden Door.png new file mode 100644 index 0000000..9ecd5ed Binary files /dev/null and b/app/src/main/assets/White noise/Wooden Door.png differ diff --git a/app/src/main/assets/resources.json b/app/src/main/assets/resources.json new file mode 100644 index 0000000..a01c698 --- /dev/null +++ b/app/src/main/assets/resources.json @@ -0,0 +1,143 @@ +{ + "categories": [ + { + "name": "Sound of instrument", + "audios": [ + { + "name": "Mixing cup", + "file": "Sound of instrument data/The sound of mixing cup.mp3", + "image": "Sound of instrument/The sound of mixing cup.png" + }, + { + "name": "Sheep eating grass", + "file": "Sound of instrument data/Sheep eating grass.mp3", + "image": "Sound of instrument/Sheep eating grass.png" + }, + { + "name": "Motorcycle", + "file": "Sound of instrument data/Motorcycle.mp3", + "image": "Sound of instrument/Motorcycle.png" + }, + { + "name": "Bubble", + "file": "Sound of instrument data/Bubble.mp3", + "image": "Sound of instrument/Bubble.png" + }, + { + "name": "Pencil", + "file": "Sound of instrument data/Pencil.mp3", + "image": "Sound of instrument/Pencil.png" + }, + { + "name": "Boil water", + "file": "Sound of instrument data/Boil water.mp3", + "image": "Sound of instrument/Boil water.png" + }, + { + "name": "Sea breeze", + "file": "Sound of instrument data/Sea breeze.mp3", + "image": "Sound of instrument/Sea breeze.png" + }, + { + "name": "Guitar sound", + "file": "Sound of instrument data/Guitar sound.mp3", + "image": "Sound of instrument/Guitar sound.jpg" + }, + { + "name": "Piano", + "file": "Sound of instrument data/Piano.mp3", + "image": "Sound of instrument/Piano.png" + } + ] + }, + { + "name": "White noise", + "audios": [ + { + "name": "Type writer", + "file": "White noise data/Type writer.mp3", + "image": "White noise/Type writer.png" + }, + { + "name": "Hair Dryer", + "file": "White noise data/Hair Dryer.mp3", + "image": "White noise/Hair Dryer.png" + }, + { + "name": "Wooden Door", + "file": "White noise data/Wooden Door.mp3", + "image": "White noise/Wooden Door.png" + }, + { + "name": "Peeling an apple", + "file": "White noise data/Peeling an apple.mp3", + "image": "White noise/Peeling an apple.png" + }, + { + "name": "Big Ben", + "file": "White noise data/Big Ben.mp3", + "image": "White noise/Big Ben.jpg" + }, + { + "name": "Voltage wire", + "file": "White noise data/Voltage wire.mp3", + "image": "White noise/Voltage wire.jpg" + }, + { + "name": "Mechanical failure", + "file": "White noise data/Mechanical failure.mp3", + "image": "White noise/Mechanical failure.png" + }, + { + "name": "Rhythm", + "file": "White noise data/Rhythm.mp3", + "image": "White noise/Rhythm.jpg" + },{ + "name": "Speed car", + "file": "White noise data/Speed car.mp3", + "image": "White noise/Speed car.png" + } + ] + }, + { + "name": "Voice of Nature", + "audios": [ + { + "name": "Birdsong", + "file": "Voice of Nature data/Birdsong.mp3", + "image": "Voice of Nature/Birdsong.png" + }, + { + "name": "Lightning Storm", + "file": "Voice of Nature data/Lightning Storm.mp3", + "image": "Voice of Nature/Lightning Storm.png" + }, + { + "name": "High -speed stream", + "file": "Voice of Nature data/High -speed stream.mp3", + "image": "Voice of Nature/High -speed stream.jpg" + }, + { + "name": "Frog croaking", + "file": "Voice of Nature data/Frog croaking.mp3", + "image": "Voice of Nature/Frog croaking.png" + }, + { + "name": "Early morning", + "file": "Voice of Nature data/Early morning.mp3", + "image": "Voice of Nature/Early morning.png" + }, + { + "name": "Rain falls in the leaves", + "file": "Voice of Nature data/Rain falls in the leaves.mp3", + "image": "Voice of Nature/Rain falls in the leaves.png" + }, + { + "name": "Wind blow", + "file": "Voice of Nature data/Wind blow.mp3", + "image": "Voice of Nature/Wind blow.jpg" + } + ] + } + ] +} \ No newline at end of file diff --git a/app/src/main/java/com/kitobochi/softapp/task/noisetimber/ProApp.kt b/app/src/main/java/com/kitobochi/softapp/task/noisetimber/ProApp.kt new file mode 100644 index 0000000..7cc42d2 --- /dev/null +++ b/app/src/main/java/com/kitobochi/softapp/task/noisetimber/ProApp.kt @@ -0,0 +1,109 @@ +package com.kitobochi.softapp.task.noisetimber + +import android.app.Application +import android.content.Context +import com.kitobochi.softapp.task.noisetimber.db.bean.Audio +import com.kitobochi.softapp.task.noisetimber.db.bean.CurrentPlayingAudio +import com.kitobochi.softapp.task.noisetimber.db.bean.ResourcesList +import com.kitobochi.softapp.task.noisetimber.db.tools.CurrentAudioManager +import com.kitobochi.softapp.task.noisetimber.db.tools.DatabaseManager +import com.kitobochi.softapp.task.noisetimber.tools.media.MediaControllerManager +import com.kitobochi.softapp.task.noisetimber.tools.parseResources +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.launch +import kotlinx.coroutines.withContext +import java.io.BufferedReader +import java.io.InputStreamReader + +class ProApp : Application() { + companion object { + lateinit var appContext: Context + lateinit var proApp: ProApp + private set + lateinit var currentAudioManager: CurrentAudioManager + private set + lateinit var databaseManager: DatabaseManager + private set + var currentPlayingAudio: CurrentPlayingAudio? = null + private set + lateinit var importList: List