Skip to content
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

I need to set min or max audio trimming concept. #4

Open
avik-capitalnumbers opened this issue Mar 19, 2020 · 7 comments
Open

I need to set min or max audio trimming concept. #4

avik-capitalnumbers opened this issue Mar 19, 2020 · 7 comments

Comments

@avik-capitalnumbers
Copy link

Hi Intuz-production ,

Thanks Intuz-production, this is really awesome product for audio trimming.
This is not regarding issue.
I want to implement a new feature for audio trimmer. so i need to set max and min time set for both ends. like minimum audio time set must be 10 sec and maximum time set must be like 30 sec.

This is my idea. also i am trying to implement that, if you kindly help me out , it will be helpful for me as well as for this product.

Thanks,
Avik

@blazingdevil44
Copy link

did u find how to limit marker?

@avik-capitalnumbers
Copy link
Author

Yes its possible.
currently i am working with it.

@venkat6666
Copy link

Hi Intuz-production ,

Thanks Intuz-production, this is really awesome product for audio trimming.
This is not regarding issue.
I want to implement a new feature for audio trimmer. so i need to set max and min time set for both ends. like minimum audio time set must be 10 sec and maximum time set must be like 30 sec.

This is my idea. also i am trying to implement that, if you kindly help me out , it will be helpful for me as well as for this product.

Thanks,
Avik

Hii,
i to have same requirement
will you please help me to do that.

@avik-capitalnumbers
Copy link
Author

Yes sure. Already I have done this feature.
let me check from my end, Because I forget right now.
I will send code or file to you.

Thanks man Don't worry.

@iharshb
Copy link

iharshb commented Aug 7, 2020

Thanks for this amazing demo. Want to set minimum audio time to 20 sec. Waiting for your reply @avik-capitalnumbers .

@avik-capitalnumbers
Copy link
Author

***Your own class change the method:-

private void resetPositions() {
mStartPos = audioWaveform.secondsToPixels(0.0);
mEndPos = audioWaveform.secondsToPixels(30.0);
}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

*** You have to handle you code here.

@OverRide
public void markerTouchMove(MarkerView marker, float x) {

    float delta = x - registrationView2.mTouchStart;
    Log.d("delta","::::::::::::::::::::::::"+delta);

    if (marker == registrationView2.markerStart) {

        Log.d("markerEnd.mStartPos",":::"+registrationView2.mStartPos);
        Log.d("markerEnd.mEndPos",":::"+registrationView2.mEndPos);

        Log.d("DISTANCE",":::"+(Float.parseFloat(registrationView2.formatTime(registrationView2.mEndPos)) -
                (Float.parseFloat(registrationView2.formatTime(registrationView2.mStartPos)))));

        if(delta>=0){
            registrationView2.mStartPos = registrationView2.trap((int) (registrationView2.mTouchInitialStartPos + delta));
        }

        if (Float.parseFloat(registrationView2.formatTime(registrationView2.mEndPos)) -
                (Float.parseFloat(registrationView2.formatTime(registrationView2.mStartPos)))<=30.00) {
            registrationView2.mStartPos = registrationView2.trap((int) (registrationView2.mTouchInitialStartPos + delta));
            //registrationView2.mEndPos = registrationView2.trap((int) (registrationView2.mTouchInitialEndPos + delta));
        }

    } else {

        Log.d("markerEnd.mStartPos",":::"+registrationView2.mStartPos);
        Log.d("markerEnd.mEndPos",":::"+registrationView2.mEndPos);

        Log.d("DISTANCE",":::"+(Float.parseFloat(registrationView2.formatTime(registrationView2.mEndPos)) -
                (Float.parseFloat(registrationView2.formatTime(registrationView2.mStartPos)))));

        if(delta<-1){
            registrationView2.mEndPos = registrationView2.trap((int) (registrationView2.mTouchInitialEndPos + delta));
        }

        Log.d("CHECK",":::"+(Float.parseFloat(registrationView2.formatTime(registrationView2.mEndPos)))+"|||"+(Float.parseFloat(registrationView2.formatTime(registrationView2.mStartPos))));

        if ((Float.parseFloat(registrationView2.formatTime(registrationView2.mEndPos)) -
                (Float.parseFloat(registrationView2.formatTime(registrationView2.mStartPos))))<=30.00) {

            registrationView2.mEndPos = registrationView2.trap((int) (registrationView2.mTouchInitialEndPos + delta));
            if (registrationView2.mEndPos < registrationView2.mStartPos)
                registrationView2.mEndPos = registrationView2.mStartPos;

        }else {
            Log.d("markerEnd.mEndPos",":::::::::::WRONG");

            /*if((Float.parseFloat(registrationView2.formatTime(registrationView2.mEndPos)) -
                    (Float.parseFloat(registrationView2.formatTime(registrationView2.mStartPos))))>30.00){
                registrationView2.mEndPos = registrationView2.mEndPos
                        -registrationView2.audioWaveform.secondsToPixels((Float.parseFloat(registrationView2.formatTime(registrationView2.mEndPos)) -
                        (Float.parseFloat(registrationView2.formatTime(registrationView2.mStartPos))))-30);

            }*/

        }

    }

    registrationView2.updateDisplay();
}

@faisalnaeem7000
Copy link

Hi, thanks for this wonderful help. But after saving wav file its empty. Could you please help that out?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants