semantive / waveform-android Goto Github PK
View Code? Open in Web Editor NEWWaveform view for Android (no longer actively maintained)
License: Apache License 2.0
Waveform view for Android (no longer actively maintained)
License: Apache License 2.0
Hi.
I found an issue that when trying to create CheapSoundFile object for short WAV file it crashes.
It happened for WAV files with duration 5 and 20 seconds.
Here is the stack trace:
java.lang.ArrayIndexOutOfBoundsException: length=1024; index=1024 at com.semantive.waveformandroid.waveform.soundfile.WavFile.readFramesInternal(WavFile.java:276) at com.semantive.waveformandroid.waveform.soundfile.WavFile.readFrames(WavFile.java:266) at com.semantive.waveformandroid.waveform.soundfile.CheapWAV.ReadFile(CheapWAV.java:103) at com.semantive.waveformandroid.waveform.soundfile.CheapSoundFile.create(CheapSoundFile.java:100) at com.appunite.zumba.view.playlist.addsoundeffect.SoundEffectActivity.onCreate(SoundEffectActivity.java:118) at android.app.Activity.performCreate(Activity.java:6682) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2619) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2727) at android.app.ActivityThread.-wrap12(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1478) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6121) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
Hey,
I know its not actively maintained but i was trying the code to work for .aac file, But somehow the expected header and first 8 bits of stream does not match.
It throws an IOException of java.io.IOException("Unknown file format");
I am unable to enter this condition in CheapAAC class.
if (header[0] == 0 && header[4] == 'f' && header[5] == 't' && header[6] == 'y' && header[7] == 'p')
I have tried logging my header values and they are as follows :
header[0] : -1 header[1] : -7 header[2] : 80 header[3] : -128 header[4] : 28 header[5] : -65 header[6] : -4 header[7] : -125
I have no idea how the header should be for .AAC files, any guidance regarding this would be very helpful.
how to close zoom ? i want waveform all in screen , do not need move waveform
It seems like the fragment doesn't restore the file name properly when instance state is created. I have tried to extend the custom fragment to gracefully save and restore the filename in the instance state but the problem is somewhere deeper in the library. Does anyone had the same issue?
Any solution?
I reviewed the code but I'm unable to find the getStartTime or getEndTime method. I'm missing something or they simple don't exist?
I have 5 minutes mp3 file. It took 20-22 seconds to create wave form. Is there any method to do it early
cheapsoundfile not writefile in android 11
output mp3 file will be blank
I am getting this error when building the code. I am new to android development, would be great if you could help me out.
I've tried implementing it using my ZTE Axon 7 running Android 7.1.
Sfter it successfuly created the waveform (as I understood), trying to play it causes only noise from the speaker.
/**
* Provide path to your audio file.
*
* @return
*/
@OverRide
protected String getFileName() {
return "path to your audio file";
}
What is the need to fill in the audio file path here? Please give an example? I filled in /storage/emulated/0/Download/test.wav and still can't find the file (provided this path has this file)
10-20 08:42:20.797 154-23476/? E/MtkOmxAudioDecBase: MtkOmxAudioDecBase:SetParameter unsupported nParamIndex(0x7F00001E) 10-20 08:42:20.808 154-23476/? E/OMXCodec: @@ [OUT] def.nBufferSize = 65536 10-20 08:42:20.808 154-23476/? E/OMXCodec: @@ [OUT] totalSize = 590336 10-20 08:42:20.876 23459-23475/? E/WaveformFragment: Error while loading sound file java.lang.ArrayIndexOutOfBoundsException: length=65536; index=65536 at com.semantive.waveformandroid.waveform.soundfile.WavFile.readFramesInternal(WavFile.java:274) at com.semantive.waveformandroid.waveform.soundfile.WavFile.readFrames(WavFile.java:265) at com.semantive.waveformandroid.waveform.soundfile.CheapWAV.ReadFile(CheapWAV.java:104) at com.semantive.waveformandroid.waveform.soundfile.CheapSoundFile.create(CheapSoundFile.java:100) at com.semantive.waveformandroid.waveform.WaveformFragment$2.run(WaveformFragment.java:445) 10-20 08:42:20.975 23459-23459/? E/MediaPlayer: Should have subtitle controller already set
its give error FileNotFoundException while i am trying to play from raw folder.
The waveform once played cannot be repeated or replayed.
I am using Android Studio 1.2.2 / Mac OSX 10.10.3 / GenyMotion Emulator Nexus 5 with Lollipop build.
I facing one small issue.,
Same audio I was loaded into AudioPlayer as well as waveform view
Both classes return an audioDuration for example
int audioDuration = AudioPlayer.getDuration(); //Example value:15935
int mPlayEndMsec = mWaveformView.pixelsToMillisecs(mEndPos) //Example value: 15900
So, I can't identify the user select the exact end position of the audio because selected Value (mPlayEndMsec ) not matched with actual value (audioDuration ). Is there any workaround is there? Please guide me with some solution.
I just want to display a WaveformView, not attached to playing a file.
I call
CheapSoundFile file = null;
try
{
file = CheapSoundFile.create("/sdcard/malo.m4a", new CheapSoundFile.ProgressListener()
{
@Override
public boolean reportProgress(double v)
{
return true;
}
} );
} catch (IOException e)
{
e.printStackTrace();
}
if (file != null) waveFormView.setSoundFile(file);
And it spins endlessly, somewhere in WaveFormView.onDraw();
What else do I have to do here?
Can you please add your project into a repository so that we can use
dependencies {
compile 'com.semantive.waveform-android:app:1.0.0'
}
Hello!
Can you please suggest me what can i do with "Went over 7 bytes" exception? One of my test devices always trows it at CheapAAC.parseMp4(CheapAAC.java:285). It's always "7" bytes for every m4a file that i try to use. How can i solve it?
Thanks.
Serge.
Hello,
May I ask what the correct way is to give the path of an .mp3 music file on SD card for function getFileName() ?
@Override
protected String getFileName() {
return "path to your audio file";
}
I tried several ways, but I always get java.io.FileNotFoundException. I use a KitKat based phone for testing.
Any help would be appreciated! Thank you in advance!
Regards,
Daniel
I am trying to compile the application but it keeps on giving me the same error.
Information:Gradle tasks [:app:assembleDebug]
plugin name 'retrolambda' is deprecated and will be removed in the next release, please change to 'me.tatarka.retrolambda'
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:compileDebugNdk UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72200Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42200Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:compileDebugJava
:app:patchAndroidJar FAILED
Error:Execution failed for task ':app:patchAndroidJar'.
Retrolambda: null/jre/lib/rt.jar does not exist, make sure that the environment variable JAVA_HOME or JAVA8_HOME, or the gradle property retrolambda.jdk points to a valid version of java8.
Please provide an issue for it.
Thank you!
Unable to add in my android project please do solve it as soon as possible
i've currently got a button which is supposed to zoom in on the waveform as required.
but as i press the button and call the waveformZoomIn() method, nothing seems to be happening.
any suggestions
I want to have a MediaRecording recording stuff, and the show a wave visualization. Is it possible for it to be done in this library?
my gradle is compileSdkVersion 23
buildToolsVersion "23.0.1" then error accour
:library:compileReleaseJavaWithJavac'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.