FireZenk/AudioWaves

Can't stop listening

Open

#13 opened on Dec 18, 2017

View on GitHub
 (6 comments) (4 reactions) (0 assignees)Java (159 forks)batch import
help wantedquestion

Repository metrics

Stars
 (808 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

Hi!

Thank you a lot for your sharing your work!

stopListening() does nothing. The visualizer is still updated.

Context : I want to start listening when I click on the start button, then stop when I click on another button.

Did anybody face this behavior?

public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
    view = inflater.inflate(R.layout.record_sound, container, false);
    visualizer = view.findViewById(R.id.visualizer);

    view.findViewById(R.id.start).setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            visualizer.startListening();
        }
    });

    view.findViewById(R.id.stop).setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            visualizer.stopListening();
        }
    });
    return view;
}

Contributor guide