diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 845ee81..ac5e317 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -20,4 +20,8 @@ jobs:
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
- run: ./gradlew build
\ No newline at end of file
+<<<<<<< HEAD
+ run: ./gradlew build
+=======
+ run: ./gradlew build
+>>>>>>> origin/main
diff --git a/LICENSE b/LICENSE
index f49a4e1..c0d6bff 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,3 +1,4 @@
+<<<<<<< HEAD
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
@@ -198,4 +199,207 @@
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
- limitations under the License.
\ No newline at end of file
+ limitations under the License.
+=======
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+>>>>>>> origin/main
diff --git a/README.md b/README.md
index 8920b8f..7be6a34 100644
--- a/README.md
+++ b/README.md
@@ -234,4 +234,8 @@ We welcome contributions from the community! If you have ideas or improvements,
## License
-WavePlayerView is licensed under the [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt).
\ No newline at end of file
+<<<<<<< HEAD
+WavePlayerView is licensed under the [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt).
+=======
+WavePlayerView is licensed under the [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt).
+>>>>>>> origin/main
diff --git a/WavePlayerView/build.gradle b/WavePlayerView/build.gradle
index d1b1197..8a0f9ff 100644
--- a/WavePlayerView/build.gradle
+++ b/WavePlayerView/build.gradle
@@ -1,3 +1,4 @@
+<<<<<<< HEAD
plugins {
id 'com.android.library'
id 'org.jetbrains.kotlin.android'
@@ -101,4 +102,73 @@ publishing {
signing {
sign publishing.publications.release
+=======
+plugins {
+ id 'com.android.library'
+ id 'org.jetbrains.kotlin.android'
+ id 'maven-publish'
+}
+
+android {
+ compileSdk 34
+
+ defaultConfig {
+ minSdk 21
+ targetSdk 34
+ namespace "sound.wave.kilobyte"
+
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled true
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+}
+
+dependencies {
+ implementation "androidx.core:core-ktx:1.10.1"
+ implementation "androidx.appcompat:appcompat:1.6.1"
+ implementation "com.google.android.material:material:1.9.0"
+ implementation "androidx.constraintlayout:constraintlayout:2.1.4"
+ testImplementation "junit:junit:4.13.2"
+ androidTestImplementation "androidx.test.ext:junit:1.1.5"
+ androidTestImplementation "androidx.test.espresso:espresso-core:3.5.1"
+}
+
+publishing {
+ publications {
+ release(MavenPublication) {
+ groupId = 'sound.wave.kilobyte'
+ artifactId = 'WavePlayerView'
+ version = '1.0'
+
+ pom {
+ name = 'WavePlayerView'
+ description = 'A Java library for analyzing sound directly by recording sound and plotting waves according to frequencies instantly. Do you think that\'s the only thing! No, on the contrary, there is also a drawing of waves according to an audio file from a track or from a file within the application.'
+ url = 'https://github.com/alex11111115/WavePlayerView'
+ licenses {
+ license {
+ name = 'The Apache License, Version 2.0'
+ url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
+ }
+ }
+ developers {
+ developer {
+ id = 'alex11111115'
+ name = 'obieda'
+ email = 'appsmarket55@gmail.com'
+ }
+ }
+ scm {
+ connection = 'scm:git:git://github.com/alex11111115/WavePlayerView.git'
+ developerConnection = 'scm:git:ssh://github.com/alex11111115/WavePlayerView.git'
+ url = 'https://github.com/alex11111115/WavePlayerView'
+ }
+ }
+ }
+ }
+>>>>>>> origin/main
}
\ No newline at end of file
diff --git a/WavePlayerView/proguard-dictionaries/package-obfuscation-dictionary.txt b/WavePlayerView/proguard-dictionaries/package-obfuscation-dictionary.txt
index e69de29..8b13789 100644
--- a/WavePlayerView/proguard-dictionaries/package-obfuscation-dictionary.txt
+++ b/WavePlayerView/proguard-dictionaries/package-obfuscation-dictionary.txt
@@ -0,0 +1 @@
+
diff --git a/WavePlayerView/src/main/AndroidManifest.xml b/WavePlayerView/src/main/AndroidManifest.xml
index aae885e..34322c4 100644
--- a/WavePlayerView/src/main/AndroidManifest.xml
+++ b/WavePlayerView/src/main/AndroidManifest.xml
@@ -3,4 +3,8 @@
-
\ No newline at end of file
+<<<<<<< HEAD
+
+=======
+
+>>>>>>> origin/main
diff --git a/WavePlayerView/src/main/java/sound/wave/kilobyte/WavePlayerView.java b/WavePlayerView/src/main/java/sound/wave/kilobyte/WavePlayerView.java
index 9657c14..1d6035f 100644
--- a/WavePlayerView/src/main/java/sound/wave/kilobyte/WavePlayerView.java
+++ b/WavePlayerView/src/main/java/sound/wave/kilobyte/WavePlayerView.java
@@ -1,8 +1,12 @@
package sound.wave.kilobyte;
+<<<<<<< HEAD
import android.Manifest;
import android.animation.ValueAnimator;
import android.app.Activity;
+=======
+import android.animation.ValueAnimator;
+>>>>>>> origin/main
import android.content.Context;
import android.content.pm.PackageManager;
import android.content.res.TypedArray;
@@ -24,6 +28,12 @@
import android.view.View;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
+<<<<<<< HEAD
+=======
+import android.Manifest;
+import android.app.Activity;
+
+>>>>>>> origin/main
import java.io.IOException;
public class WavePlayerView extends View {
@@ -263,6 +273,13 @@ public void stopAudioWithWave() {
private void setupVisualizer() {
if (mediaPlayer != null && mediaPlayer.getAudioSessionId() != -1) {
+<<<<<<< HEAD
+=======
+ //if (visualizer != null) {
+ //visualizer.release();
+ //}
+
+>>>>>>> origin/main
try {
visualizer = new Visualizer(mediaPlayer.getAudioSessionId());
visualizer.setCaptureSize(Visualizer.getCaptureSizeRange()[1]);
@@ -425,7 +442,13 @@ public void stopListening() {
audioRecord = null;
}
}
+<<<<<<< HEAD
+ public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
+=======
+ //@Override
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
+ //super.onRequestPermissionsResult(requestCode, permissions, grantResults);
+>>>>>>> origin/main
switch (requestCode) {
case REQUEST_RECORD_AUDIO_PERMISSION:
permissionToRecordAccepted = grantResults[0] == PackageManager.PERMISSION_GRANTED;
@@ -433,4 +456,8 @@ public void onRequestPermissionsResult(int requestCode, String[] permissions, in
}
if (!permissionToRecordAccepted) ((Activity) getContext()).finish();
}
-}
\ No newline at end of file
+<<<<<<< HEAD
+}
+=======
+}
+>>>>>>> origin/main
diff --git a/app/build.gradle b/app/build.gradle
index f23aa32..5495f3f 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -1,7 +1,10 @@
plugins {
id 'com.android.application'
+<<<<<<< HEAD
id 'org.jetbrains.kotlin.android'
+=======
+>>>>>>> origin/main
}
@@ -23,7 +26,11 @@ android {
buildTypes {
release {
+<<<<<<< HEAD
minifyEnabled false
+=======
+ minifyEnabled true
+>>>>>>> origin/main
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
@@ -32,20 +39,26 @@ android {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
+<<<<<<< HEAD
kotlinOptions {
jvmTarget = "17"
}
+=======
+>>>>>>> origin/main
buildFeatures {
viewBinding true
}
+<<<<<<< HEAD
composeOptions {
kotlinCompilerExtensionVersion = "2.0.0"
}
+=======
+>>>>>>> origin/main
}
dependencies {
@@ -54,4 +67,8 @@ dependencies {
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("com.google.android.material:material:1.9.0")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
-}
\ No newline at end of file
+<<<<<<< HEAD
+}
+=======
+}
+>>>>>>> origin/main
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
index e69de29..8b13789 100644
--- a/app/proguard-rules.pro
+++ b/app/proguard-rules.pro
@@ -0,0 +1 @@
+
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 7a9fdc9..c208e2f 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -10,6 +10,7 @@
>>>>>> origin/main
tools:targetApi="34">
+=======
+ android:supportsPictureInPicture="true"
+ android:exported="true">
+
+
+
+>>>>>>> origin/main
diff --git a/app/src/main/java/sound/wave/kilobyte/MainActivity.java b/app/src/main/java/sound/wave/kilobyte/MainActivity.java
index 7e8174c..3adb3a9 100644
--- a/app/src/main/java/sound/wave/kilobyte/MainActivity.java
+++ b/app/src/main/java/sound/wave/kilobyte/MainActivity.java
@@ -13,18 +13,30 @@
import android.os.Handler;
import android.os.Looper;
import android.provider.MediaStore;
+<<<<<<< HEAD
import android.widget.EditText;
import android.widget.SeekBar;
import com.google.android.material.button.MaterialButton;
import com.google.android.material.textview.MaterialTextView;
+=======
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.SeekBar;
+import android.widget.TextView;
+>>>>>>> origin/main
import androidx.activity.result.ActivityResultLauncher;
import androidx.activity.result.contract.ActivityResultContracts;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
+<<<<<<< HEAD
import androidx.activity.result.ActivityResultLauncher;
import androidx.activity.result.contract.ActivityResultContracts;
import androidx.core.content.ContextCompat;
+=======
+import androidx.core.content.ContextCompat;
+import java.io.IOException;
+>>>>>>> origin/main
import java.util.ArrayList;
public class MainActivity extends AppCompatActivity {
@@ -32,6 +44,7 @@ public class MainActivity extends AppCompatActivity {
private Handler handler = new Handler(Looper.getMainLooper());
private String file = "";
private double value = 0;
+<<<<<<< HEAD
private String playbackSpeed = "1.0";
private WavePlayerView waveView;
@@ -39,6 +52,15 @@ public class MainActivity extends AppCompatActivity {
private MaterialTextView currentTimeTextView;
private SeekBar progressBar;
private MaterialTextView durationTextView;
+=======
+ private String s = "";
+
+ private WavePlayerView waveView;
+ private EditText edittext1;
+ private TextView currentTimeTextView;
+ private SeekBar progressbar1;
+ private TextView durationTextView;
+>>>>>>> origin/main
private ActivityResultLauncher activityResultLauncher;
@@ -52,10 +74,15 @@ protected void onCreate(Bundle savedInstanceState) {
}
private void requestPermissions() {
+<<<<<<< HEAD
if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, 1000);
} else if (ContextCompat.checkSelfPermission(this, Manifest.permission.RECORD_AUDIO) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.RECORD_AUDIO}, 9653);
+=======
+ if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_DENIED) {
+ ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, 1000);
+>>>>>>> origin/main
} else {
initializeLogic();
}
@@ -66,13 +93,17 @@ public void onRequestPermissionsResult(int requestCode, @NonNull String[] permis
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
if (requestCode == 1000 && grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
initializeLogic();
+<<<<<<< HEAD
} else if (requestCode == 9653 && grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
initializeLogic();
+=======
+>>>>>>> origin/main
}
}
private void initialize() {
waveView = findViewById(R.id.waveView);
+<<<<<<< HEAD
filePathEditText = findViewById(R.id.edittext1);
currentTimeTextView = findViewById(R.id.currentTimeTextView);
progressBar = findViewById(R.id.progressbar1);
@@ -124,6 +155,55 @@ private void initialize() {
updateWavePropertiesButton.setOnClickListener(view -> updateWaveProperties());
progressBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
+=======
+ edittext1 = findViewById(R.id.edittext1);
+ currentTimeTextView = findViewById(R.id.currentTimeTextView);
+ progressbar1 = findViewById(R.id.progressbar1);
+ durationTextView = findViewById(R.id.durationTextView);
+
+ Button button2 = findViewById(R.id.button2);
+ button2.setOnClickListener(view -> waveView.startListening());
+
+ Button button3 = findViewById(R.id.button3);
+ button3.setOnClickListener(view -> waveView.stopListening());
+
+ Button pick = findViewById(R.id.pick);
+ pick.setOnClickListener(view -> {
+ Intent w = new Intent(Intent.ACTION_OPEN_DOCUMENT);
+ w.setType("audio/*");
+ w.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, false);
+ activityResultLauncher.launch(w);
+ });
+
+ Button play_with_file_path = findViewById(R.id.play_with_file_path);
+ play_with_file_path.setOnClickListener(view -> playAudioFromFile());
+
+ Button play_from_app = findViewById(R.id.play_from_app);
+ play_from_app.setOnClickListener(view -> playAudioFromApp());
+
+ Button stop = findViewById(R.id.stop);
+ stop.setOnClickListener(view -> stopAudio());
+
+ Button resume = findViewById(R.id.resume);
+ resume.setOnClickListener(view -> {
+ waveView.resumeAudioWithWave();
+ waveView.setPlaybackSpeed(s);
+ });
+
+ Button pause = findViewById(R.id.pause);
+ pause.setOnClickListener(view -> waveView.pauseAudioWithWave());
+
+ Button button4 = findViewById(R.id.button4);
+ button4.setOnClickListener(view -> {
+ s = ((EditText) findViewById(R.id.edittext7)).getText().toString();
+ waveView.setPlaybackSpeed(s);
+ });
+
+ Button update = findViewById(R.id.update);
+ update.setOnClickListener(view -> updateWaveProperties());
+
+ progressbar1.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
+>>>>>>> origin/main
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
value = progress;
@@ -137,6 +217,7 @@ public void onStartTrackingTouch(SeekBar seekBar) {
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
waveView.seekToPosition((int) value);
+<<<<<<< HEAD
waveView.setPlaybackSpeed(playbackSpeed);
}
});
@@ -146,6 +227,17 @@ public void onStopTrackingTouch(SeekBar seekBar) {
MaterialButton showWave2Button = findViewById(R.id.show_wave2);
showWave2Button.setOnClickListener(view -> waveView.setWave2Visible(true));
+=======
+ waveView.setPlaybackSpeed(s);
+ }
+ });
+
+ Button hide_wave2 = findViewById(R.id.hide_wave2);
+ hide_wave2.setOnClickListener(view -> waveView.setWave2Visible(false));
+
+ Button show_wave2 = findViewById(R.id.show_wave2);
+ show_wave2.setOnClickListener(view -> waveView.setWave2Visible(true));
+>>>>>>> origin/main
activityResultLauncher = registerForActivityResult(
new ActivityResultContracts.StartActivityForResult(),
@@ -162,7 +254,11 @@ public void onStopTrackingTouch(SeekBar seekBar) {
filePaths.add(FileUtil.convertUriToFilePath(getApplicationContext(), data.getData()));
}
if (!filePaths.isEmpty()) {
+<<<<<<< HEAD
filePathEditText.setText(filePaths.get(0));
+=======
+ edittext1.setText(filePaths.get(0));
+>>>>>>> origin/main
}
}
}
@@ -170,8 +266,13 @@ public void onStopTrackingTouch(SeekBar seekBar) {
}
private void initializeLogic() {
+<<<<<<< HEAD
waveView.setOnAudioCompleteListener(() -> progressBar.setProgress(0));
playbackSpeed = "1.0";
+=======
+ waveView.setOnAudioCompleteListener(() -> progressbar1.setProgress(0));
+ s = "1.0";
+>>>>>>> origin/main
}
private void playAudioFromFile() {
@@ -181,15 +282,23 @@ private void playAudioFromFile() {
waveView.setOnAudioProgressListener(currentTime -> {
String currentTimeStr = formatMilliseconds(currentTime);
currentTimeTextView.setText(currentTimeStr);
+<<<<<<< HEAD
progressBar.setProgress(currentTime);
});
file = filePathEditText.getText().toString();
+=======
+ progressbar1.setProgress((int) currentTime);
+ });
+
+ file = edittext1.getText().toString();
+>>>>>>> origin/main
waveView.playAudioWithWaveFromPath(file);
handler.postDelayed(() -> {
int duration = waveView.getAudioDuration();
String durationStr = formatMilliseconds(duration);
durationTextView.setText(durationStr);
+<<<<<<< HEAD
progressBar.setMax(duration);
}, 50);
@@ -197,6 +306,15 @@ private void playAudioFromFile() {
waveView.setPlaybackSpeed(playbackSpeed);
} catch (IllegalArgumentException e) {
e.printStackTrace();
+=======
+ progressbar1.setMax((int) duration);
+ }, 50);
+
+ try{
+ waveView.setPlaybackSpeed(s);
+ }catch(IllegalArgumentException e){
+ e.getStackTrace();
+>>>>>>> origin/main
}
}
}
@@ -208,7 +326,11 @@ private void playAudioFromApp() {
waveView.setOnAudioProgressListener(currentTime -> {
String currentTimeStr = formatMilliseconds(currentTime);
currentTimeTextView.setText(currentTimeStr);
+<<<<<<< HEAD
progressBar.setProgress(currentTime);
+=======
+ progressbar1.setProgress((int) currentTime);
+>>>>>>> origin/main
});
waveView.playAudioWithWave(R.raw.mus);
@@ -216,14 +338,22 @@ private void playAudioFromApp() {
int duration = waveView.getAudioDuration();
String durationStr = formatMilliseconds(duration);
durationTextView.setText(durationStr);
+<<<<<<< HEAD
progressBar.setMax(duration);
}, 1000);
waveView.setPlaybackSpeed(playbackSpeed);
+=======
+ progressbar1.setMax((int) duration);
+ }, 1000);
+
+ waveView.setPlaybackSpeed(s);
+>>>>>>> origin/main
}
}
private void updateWaveProperties() {
+<<<<<<< HEAD
if (ContextCompat.checkSelfPermission(this, Manifest.permission.RECORD_AUDIO) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.RECORD_AUDIO}, 9653);
} else {
@@ -245,17 +375,41 @@ private void updateWaveProperties() {
} catch (IllegalArgumentException e) {
e.printStackTrace();
}
+=======
+ String editText2Value = ((EditText) findViewById(R.id.edittext2)).getText().toString();
+ String editText3Value = ((EditText) findViewById(R.id.edittext3)).getText().toString();
+ String editText4Value = ((EditText) findViewById(R.id.edittext4)).getText().toString();
+ String editText5Value = ((EditText) findViewById(R.id.edittext5)).getText().toString();
+ String editText6Value = ((EditText) findViewById(R.id.edittext6)).getText().toString();
+
+ if (!(editText2Value.isEmpty() && editText3Value.isEmpty() && editText4Value.isEmpty() && editText5Value.isEmpty() && editText6Value.isEmpty())) {
+ try {
+ int color1 = Color.parseColor(editText2Value);
+ float wave1Width = Float.parseFloat(editText3Value);
+ int color2 = Color.parseColor(editText4Value);
+ float wave2Width = Float.parseFloat(editText5Value);
+ float waveSpeed = Float.parseFloat(editText6Value);
+
+ waveView.setWaveProperties(color1, wave1Width, color2, wave2Width, waveSpeed);
+ } catch (IllegalArgumentException e) {
+ e.printStackTrace();
+>>>>>>> origin/main
}
}
}
private void stopAudio() {
+<<<<<<< HEAD
if (ContextCompat.checkSelfPermission(this, Manifest.permission.RECORD_AUDIO) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.RECORD_AUDIO}, 9653);
} else {
if (waveView != null) {
waveView.stopAudioWithWave();
}
+=======
+ if (waveView != null) {
+ waveView.stopAudioWithWave();
+>>>>>>> origin/main
}
}
@@ -284,7 +438,11 @@ public static String convertUriToFilePath(Context context, Uri uri) {
if (uri == null) {
return null;
}
+<<<<<<< HEAD
+=======
+
+>>>>>>> origin/main
if ("content".equalsIgnoreCase(uri.getScheme())) {
String[] projection = {MediaStore.Audio.Media.DATA};
try (Cursor cursor = context.getContentResolver().query(uri, projection, null, null, null)) {
@@ -301,4 +459,8 @@ public static String convertUriToFilePath(Context context, Uri uri) {
return null;
}
}
-}
\ No newline at end of file
+<<<<<<< HEAD
+}
+=======
+}
+>>>>>>> origin/main
diff --git a/app/src/main/res/layout/main.xml b/app/src/main/res/layout/main.xml
index 58828db..ca69fe4 100644
--- a/app/src/main/res/layout/main.xml
+++ b/app/src/main/res/layout/main.xml
@@ -1,3 +1,4 @@
+<<<<<<< HEAD
-
\ No newline at end of file
+
+=======
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+>>>>>>> origin/main
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
index 3883957..af53f2b 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -4,8 +4,13 @@
#8E8DE5#E8D8FB#9F9FF9
+<<<<<<< HEAD
#222327#E8D8FB#feb#222327
+=======
+ #222327
+ #E8D8FB
+>>>>>>> origin/main
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index 7e2e67f..6cbfc9f 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -6,7 +6,11 @@
@color/colorAccent@color/colorControlHighlight@color/colorControlNormal
+<<<<<<< HEAD
@color/backgroundColorDark
+=======
+ @color/backgroundColor
+>>>>>>> origin/main
diff --git a/build.gradle b/build.gradle
index 591cc7f..b16202f 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,4 +1,5 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
+<<<<<<< HEAD
buildscript {
dependencies {
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
@@ -6,10 +7,13 @@ buildscript {
}
}
+=======
+>>>>>>> origin/main
plugins {
id 'com.android.application' version "8.1.1" apply false
id 'com.android.library' version "8.1.1" apply false
id 'org.jetbrains.kotlin.android' version "2.0.0" apply false
+<<<<<<< HEAD
id 'maven-publish'
id 'signing'
@@ -22,4 +26,16 @@ if (tasks.findByName('clean') == null) {
task clean(type: Delete) {
delete rootProject.buildDir
}
+=======
+}
+
+dependencies {
+ //classpath 'com.android.tools.build:gradle:8.1.1'
+ //classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:2.0.0'
+ //classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
+}
+
+task clean(type: Delete) {
+ delete rootProject.buildDir
+>>>>>>> origin/main
}
\ No newline at end of file
diff --git a/gradle.properties b/gradle.properties
index 6a3619f..57125ce 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -44,10 +44,14 @@ POM_DEVELOPER_NAME=obieda
POM_DEVELOPER_EMAIL=appsmarket55@gmail.com
POM_SCM_CONNECTION=scm:git:git://github.com/alex11111115/WavePlayerView.git
POM_SCM_DEVELOPER_CONNECTION=scm:git:ssh://github.com/alex11111115/WavePlayerView.git
+<<<<<<< HEAD
POM_SCM_URL=https://github.com/alex11111115/WavePlayerView
signing.keyId=220b 1278 6535 58a3
signing.password=I11hzHgYFbjXBvGFL0WdmbyGngsXSI+sd2w1XpdOSkNS
signing.secretKeyRingFile=/WavePlayerView/SAtZcntv.asc
ossrhUsername=SAtZcntv
-ossrhPassword=I11hzHgYFbjXBvGFL0WdmbyGngsXSI+sd2w1XpdOSkNS
\ No newline at end of file
+ossrhPassword=I11hzHgYFbjXBvGFL0WdmbyGngsXSI+sd2w1XpdOSkNS
+=======
+POM_SCM_URL=https://github.com/alex11111115/WavePlayerView
+>>>>>>> origin/main
diff --git a/settings.gradle b/settings.gradle
index d94d537..50d7d4d 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1,14 +1,20 @@
+<<<<<<< HEAD
import org.gradle.api.initialization.resolve.RepositoriesMode.*
+=======
+>>>>>>> origin/main
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
+<<<<<<< HEAD
mavenLocal()
maven { url = uri("https://jitpack.io") }
maven { url = uri("https://repo1.maven.org/maven2") }
maven { url = uri("https://mvnrepository.com/repos/central") }
+=======
+>>>>>>> origin/main
}
}
@@ -17,10 +23,13 @@ dependencyResolutionManagement {
repositories {
google()
mavenCentral()
+<<<<<<< HEAD
mavenLocal()
maven { url = uri("https://jitpack.io") }
maven { url = uri("https://repo1.maven.org/maven2") }
maven { url = uri("https://mvnrepository.com/repos/central") }
+=======
+>>>>>>> origin/main
}
}