Git Product home page Git Product logo

irecordview's People

Contributors

3llomi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

irecordview's Issues

Getting Nil value from Bundle with corresponding identifier

Hi @3llomi ,

I'm getting nil value on Bundle from AudioPlayer.swift file which is on pod. So unable to play the recorded audio file as well as unable to fetch it.

let bundle = Bundle(identifier: "org.cocoapods.iRecordView")

public func playAudioFile(soundType: AudioPlayerSounds) {
        let bundle = Bundle(identifier: "org.cocoapods.iRecordView")
        
        guard let url = bundle?.url(forResource: getPathByType(soundType: soundType), withExtension: "wav") else{
            print("error getting Sound URL")
            return
        }
        do {
            player = try AVAudioPlayer(contentsOf: url)
            player.play()

        } catch {
            print("could not play audio file!")
        }
    }

Some property not found after install from pods

I am using version iRecordView (0.1.4)
when i install through pods it will give me below errors.

Property 'recordView' not found on object of type 'RecordButton *'
Property 'delegate' not found on object of type 'RecordView *'
Property 'duration' not found on object of type 'RecordView *'

iRecordView not working when app in release mode

I'm developing a messenger app in which I'm using https://github.com/3llomi/iRecordView library to record voice messages. Everything works fine in debug mode. But when I release the app to App Store and later use the app after downloading from App Store it does not work.

Expected behaviour is that on pressing the record button it makes sound and starts recording as shown in the demo https://github.com/3llomi/iRecordView

But in release mode (App downloaded from App Store) when I press the button nothing happens. There are no crash reports on App Store Connect. Could someone please help me on how could I get device logs or what the problem could be?

From what I could guess is that RecordViewDelegate methods are not being called

self.recordView.delegate = self
is not working I guess. Any suggestions how this could be resolved?

Fatal Exception: java.lang.NullPointerException

Fatal Exception: java.lang.NullPointerException
Attempt to invoke virtual method 'void com.devlomi.record_view.RecordView.onActionDown(com.devlomi.record_view.RecordButton, android.view.MotionEvent)' on a null object reference
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.devlomi.record_view.RecordView.onActionDown(com.devlomi.record_view.RecordButton, android.view.MotionEvent)' on a null object reference
at com.devlomi.record_view.RecordButton.onTouch(RecordButton.java:105)
at android.view.View.dispatchTouchEvent(View.java:10058)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2782)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2361)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2782)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2361)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2782)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2361)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2782)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2361)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2782)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2361)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2782)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2361)
at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:435)
at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1836)
at android.app.Activity.dispatchTouchEvent(Activity.java:3063)
at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:69)
at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:397)
at android.view.View.dispatchPointerEvent(View.java:10298)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4928)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4787)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4293)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4346)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4312)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4459)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4320)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4516)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4293)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4346)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4312)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4320)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4293)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:6817)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:6791)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6734)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:6989)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185)
at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
at android.os.MessageQueue.next(MessageQueue.java:328)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:6251)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1075)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

My Code I Used

private void initViewAudio(){
binding.recordButton.setRecordView(binding.recordView);
binding.recordView.setSoundEnabled(true);
binding.recordView.setShimmerEffectEnabled(true);
binding.recordView.setRecordButtonGrowingAnimationEnabled(true);

    binding.recordView.setCustomSounds(R.raw.record_start,R.raw.record_finished,R.raw.record_error);

    binding.recordButton.setListenForRecord(false);

    //ListenForRecord must be false ,otherwise onClick will not be called
    binding.recordButton.setOnRecordClickListener(new OnRecordClickListener() {
        @Override
        public void onClick(View v) {
            Toast.makeText(ChatActivity.this, "RECORD BUTTON CLICKED", Toast.LENGTH_SHORT).show();
            Log.d("RecordButton","RECORD BUTTON CLICKED");
        }
    });


    binding.recordView.setOnBasketAnimationEndListener(new OnBasketAnimationEnd() {
        @Override
        public void onAnimationEnd() {
            Log.d("RecordView", "Basket Animation Finished");
        }
    });

    binding.recordView.setRecordPermissionHandler(new RecordPermissionHandler() {
        @Override
        public boolean isPermissionGranted() {
            if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
                return true;
            }

            boolean recordPermissionAvailable = ContextCompat.checkSelfPermission(ChatActivity.this, Manifest.permission.RECORD_AUDIO) == PERMISSION_GRANTED;
            if (recordPermissionAvailable) {
                return true;
            }


            ActivityCompat.
                    requestPermissions(ChatActivity.this,
                            new String[]{Manifest.permission.RECORD_AUDIO},
                            0);

            return false;

        }
    });




    binding.recordView.setOnRecordListener(new OnRecordListener() {
        @Override
        public void onStart() {
            //Start Recording..

// Log.d("RecordView", "onStart");
setUpRecording();
try {
recorder.prepare();
} catch (IOException e) {
e.printStackTrace();
}
recorder.start();
binding.cardView.setVisibility(View.INVISIBLE);
binding.recordView.setVisibility(View.VISIBLE);

        }

        @Override
        public void onCancel() {
            //On Swipe To Cancel

// Log.d("RecordView", "onCancel");
recorder.reset();
recorder.release();
File file = new File(filename);
if (file.exists())
file.delete();
binding.recordView.setVisibility(View.GONE);
binding.messageLayout.setVisibility(View.VISIBLE);
}

        @Override
        public void onFinish(long recordTime, boolean limitReached) {
            //Stop Recording..
            //limitReached to determine if the Record was finished when time limit reached.

// String time = getHumanTimeText(recordTime);
Log.d("RecordView", "onFinish");
recorder.stop();
recorder.release();
// Log.d("RecordTime", time);
binding.recordView.setVisibility(View.GONE);
binding.messageLayout.setVisibility(View.VISIBLE);
}

        @Override
        public void onLessThanSecond() {
            //When the record time is less than One Second
            Log.d("RecordView", "onLessThanSecond");
            recorder.reset();
            recorder.release();
            File file = new File(filename);
            if (file.exists())
                file.delete();
            binding.recordView.setVisibility(View.GONE);
            binding.messageLayout.setVisibility(View.VISIBLE);
        }
    });


}

private void setUpRecording(){
    MediaRecorder recorder = new MediaRecorder();
    recorder.reset();
    recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
    recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
    recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
    File file = new File(Environment.getExternalStorageDirectory().getAbsolutePath(),"MolaChat/Media/Recording");
    if (!file.exists())
        file.mkdirs();
    filename=file.getAbsolutePath() + File.separator + System.currentTimeMillis()+".3gp";
    recorder.setOutputFile(filename);

Please If This Is a Bug Please Fix Sir Or Any Mistake In My Code
Tell Me I am new For Coding And Making App Like Whatsapp

Dustbin animation not working properly after cancelling

The dustbin animation flickers and is not smooth and sometimes the red mic image upon cancellation blinks on the left side before becoming invisible even after animation ends, also the dustbin image is very pixelated when seen on the phone.

RPReplay_Final1640862065.MP4

holding strong reference

delegate property of record view class is strong it should be weak, I saw this issue was closed but delegate is still strong in latest version, please fix this issue asap

error getting Sound URL

Hey, I got "error getting Sound URL" when I try to record with the demo version or with my version.

Why ? How can I get the soundfile?

Thanks

App crash on IOS 12.3

delegate?.onStart()

its working fine in iOS 13 but crashed on 12.3 when I click on button.

Audio View lock

Hi Team!
Is it possible we can update the view like WhatsApp for swipe up to lock?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.