-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The Wave is flat #20
Comments
Requesting help. The seekbar is working but wave is flat (all columns same height) and alignment to top, bottom and center is same . Need urgent guidance . Please help |
@PBasil2020 Hello, send me your audio file to |
Thank you for responding. I am using multiple audio files and everywhere same. The one with maximum modulation is attached. I am using Android studio 4.2 and application is in Java. I am observing this
Regards |
…rsion also fix Issue massoudss#18, Issue massoudss#19 and Issue massoudss#20
@PBasil2020 Check WaveformSeekbar and Amplituda versions:
You should also increase WaveformSeekbar version to 2.4.0 if you want to use new Amplituda version with this fix I'll attach a screenshot with the waveform for your audio file here. |
<!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
code
{mso-style-priority:99;
font-family:"Courier New";}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0cm;
font-size:10.0pt;
font-family:"Courier New";}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:"Courier New";}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
-->Dear Lincollincol My problem persists I am using this in build .gridleimplementation 'com.github.massoudss:waveformSeekBar:2.4.0'implementation 'com.github.lincollincol:Amplituda:1.7' My sample program is as attached. RegardsPreeti Basil Sent from Mail for Windows 10 From: lincollincolSent: 17 May 2021 14:12To: massoudss/waveformSeekBarCc: PBasil2020; MentionSubject: Re: [massoudss/waveformSeekBar] The Wave is flat (#20) @PBasil2020 Check WaveformSeekbar and Amplituda versions:implementation 'com.github.massoudss:waveformSeekBar:2.4.0'implementation 'com.github.lincollincol:Amplituda:1.7'You should also increase WaveformSeekbar version to 2.4.0 if you want to use new Amplituda version with this fixI'll attach a screenshot with the waveform for your audio file here.—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or unsubscribe.
|
@PBasil2020 Try to use this step by step instruction: allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
} Module Gradle file => dependencies {
implementation 'com.github.massoudss:waveformSeekBar:2.4.0'
implementation 'com.github.lincollincol:Amplituda:1.7' // or newer version
} Step 2: <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> Step 3: <androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.masoudss.lib.WaveformSeekBar
app:wave_progress="33"
app:wave_max_progress="100"
app:wave_width="5dp"
app:wave_gap="2dp"
app:wave_min_height="5dp"
app:wave_corner_radius="2dp"
app:wave_background_color="#ffaacc"
app:wave_progress_color="#9000ff00"
app:wave_gravity="center"
android:id="@+id/waveformSeekBar"
android:layout_width="300dp"
android:layout_height="50dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout> Step 4: val waveform = findViewById<WaveformSeekBar>(R.id.waveformSeekBar)
waveform.setSampleFrom(path) // Example path => "/storage/emulated/0/Music/queen.mp3" Сonclusion
You can also send me runtime logs |
<!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0cm;
font-size:10.0pt;
font-family:"Courier New";}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:"Courier New";}
span.pl-k
{mso-style-name:pl-k;}
span.pl-s
{mso-style-name:pl-s;}
span.pl-pds
{mso-style-name:pl-pds;}
span.pl-c
{mso-style-name:pl-c;}
span.pl-ent
{mso-style-name:pl-ent;}
span.pl-e
{mso-style-name:pl-e;}
span.pl-en
{mso-style-name:pl-en;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
-->Dear Lincolincol I was using it as you have instructed. But rechecked. Wave is still flat. Pl see the output in my runtime log. 2021-05-18 20:27:50.832 28822-28822/? I/ial.musicplaye: Late-enabling -Xcheck:jni2021-05-18 20:27:50.882 28822-28822/? E/ial.musicplaye: Unknown bits set in runtime_flags: 0x80002021-05-18 20:27:50.958 28822-28842/? I/ial.musicplaye: Background young concurrent copying GC freed 2263(1477KB) AllocSpace objects, 0(0B) LOS objects, 96% free, 1001KB/24MB, paused 8.943ms total 50.590ms2021-05-18 20:27:51.252 28822-28822/com.trial.musicplayer I/Perf: Connecting to perf service.2021-05-18 20:27:51.281 28822-28886/com.trial.musicplayer E/Perf: Fail to get file list com.trial.musicplayer2021-05-18 20:27:51.282 28822-28886/com.trial.musicplayer E/Perf: getFolderSize() : Exception_1 = java.lang.NullPointerException: Attempt to get length of null array2021-05-18 20:27:51.574 28822-28822/com.trial.musicplayer W/ial.musicplaye: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed)2021-05-18 20:27:51.576 28822-28822/com.trial.musicplayer W/ial.musicplaye: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed)2021-05-18 20:27:51.829 28822-28822/com.trial.musicplayer E/AMPLITUDA: Wrong file! Please check path and try again!2021-05-18 20:27:51.933 28822-28888/com.trial.musicplayer I/AdrenoGLES: QUALCOMM build : f2ab992, I401605978b Build Date : 09/28/19 OpenGL ES Shader Compiler Version: EV031.27.05.01 Local Branch : Remote Branch : Remote Branch : Reconstruct Branch : 2021-05-18 20:27:51.933 28822-28888/com.trial.musicplayer I/AdrenoGLES: Build Config : S L 8.0.11 AArch642021-05-18 20:27:51.940 28822-28888/com.trial.musicplayer I/AdrenoGLES: PFP: 0x005ff112, ME: 0x005ff0662021-05-18 20:27:51.935 28822-28822/com.trial.musicplayer W/RenderThread: type=1400 audit(0.0:204206): avc: denied { search } for name="kgsl-3d0" dev="sysfs" ino=30653 scontext=u:r:untrusted_app:s0:c13,c258,c512,c768 tcontext=u:object_r:sysfs_kgsl:s0 tclass=dir permissive=02021-05-18 20:27:51.948 28822-28888/com.trial.musicplayer W/AdrenoUtils: <ReadGpuID_from_sysfs:194>: Failed to open /sys/class/kgsl/kgsl-3d0/gpu_model2021-05-18 20:27:51.948 28822-28888/com.trial.musicplayer W/AdrenoUtils: <ReadGpuID:218>: Failed to read chip ID from gpu_model. Fallback to use the GSL path2021-05-18 20:27:52.027 28822-28888/com.trial.musicplayer W/Gralloc3: mapper 3.x is not supported2021-05-18 20:28:17.473 28822-28845/com.trial.musicplayer W/MediaPlayer-JNI: MediaPlayer finalized without being released2021-05-18 20:28:23.238 28822-28822/com.trial.musicplayer W/MediaPlayer_JAVA: JK: stream type = 3, playback time = 22441822, device name = BUILTIN SPEAKER, volume level = 6 Regards Preeti Basil Sent from Mail for Windows 10 From: lincollincolSent: 17 May 2021 16:41To: massoudss/waveformSeekBarCc: PBasil2020; MentionSubject: Re: [massoudss/waveformSeekBar] The Wave is flat (#20) @PBasil2020 Try to use this step by step instruction:Step 1:Add dependencyProject Gradle file =>allprojects { repositories { ... maven { url 'https://jitpack.io' } }}Module Gradle file =>dependencies { implementation 'com.github.massoudss:waveformSeekBar:2.4.0' implementation 'com.github.lincollincol:Amplituda:1.7' // or newer version}Step 2:Add read/write permissions to your manifest.xml file and grant it<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /><uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />Step 3:Add WaveformSeekbar view to your layout markup. Example of layout markup:<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/layout" android:layout_width="match_parent" android:layout_height="match_parent"> <com.masoudss.lib.WaveformSeekBar app:wave_progress="33" app:wave_max_progress="100" app:wave_width="5dp" app:wave_gap="2dp" app:wave_min_height="5dp" app:wave_corner_radius="2dp" app:wave_background_color="#ffaacc" app:wave_progress_color="#9000ff00" app:wave_gravity="center" android:id="@+id/waveformSeekBar" android:layout_width="300dp" android:layout_height="50dp" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent"/> </androidx.constraintlayout.widget.ConstraintLayout>Step 4:Set samples from code inside your activity or fragment:val waveform = findViewById<WaveformSeekBar>(R.id.waveformSeekBar)waveform.setSampleFrom("/storage/emulated/0/Music/queen.mp3")You can also send me a runtime logs—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or unsubscribe.
|
@PBasil2020 Please use the correct path to the file. The file must exist and have an extension according to the audio files: mp3, wav etc. Also, check that you have granted read and write permissions. |
<!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
code
{mso-style-priority:99;
font-family:"Courier New";}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
-->I have locally stored in raw folder. Not reading it from storage. This is a trial program. Do I have to compulsory store on storage. I will now try it in some other application and will share info with you. RegardsPreeti Basil Sent from Mail for Windows 10 From: lincollincolSent: 18 May 2021 20:38To: massoudss/waveformSeekBarCc: PBasil2020; MentionSubject: Re: [massoudss/waveformSeekBar] The Wave is flat (#20) @PBasil2020 Please use the correct path to the file. The file must exist and have an extension according to the audio files: mp3, wav etc. Also, check that you have granted read and write permissions.See log message from your reply:E/AMPLITUDA: Wrong file! Please check path and try again!—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or unsubscribe.
|
@PBasil2020 Yes, you should store it on your device: internal or external (sd-card) storage. I think it would be nice to add support for raw files, but that will be a little bit later. |
@PBasil2020 Please convert your raw resource to a temp file and use the returning file:
|
<!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
code
{mso-style-priority:99;
font-family:"Courier New";}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0cm;
font-size:10.0pt;
font-family:"Courier New";}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:"Courier New";}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
-->Dear Masoud Soleimani Thank you it worked. RegardsPreeti Basil Sent from Mail for Windows 10 From: Masoud SoleimaniSent: 18 May 2021 21:44To: massoudss/waveformSeekBarCc: PBasil2020; MentionSubject: Re: [massoudss/waveformSeekBar] The Wave is flat (#20) @PBasil2020 Please convert your raw resource to a temp file and use the returning file:fun getRawResourceAsFile(): File { val inputStream = resources.openRawResource(R.raw.your_resource_name) val file = File(cacheDir, "your_file_name.mp3") try { FileOutputStream(file).use { output -> val buffer = ByteArray(4 * 1024) var read: Int while (inputStream.read(buffer).also { read = it } != -1) { output.write(buffer, 0, read) } output.flush() } } catch (e: Exception) { e.printStackTrace() } finally { inputStream.close() } return file}—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or unsubscribe.
|
The wave is not like the one you have shown. It is coming of a uniform height
The text was updated successfully, but these errors were encountered: