Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4362: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4364: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4365: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4366: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
anddev.org • View topic - Unsure about Audio!

Unsure about Audio!

Put your problem here if it does not fit any of the other categories.

Unsure about Audio!

Postby ramgraph1 » Thu Mar 06, 2008 11:50 pm

I seem to have a lot of struggles with audio.
I WAS creating a MediaPlayer in onCreate and then playing it each time the user clicked a button and using ".reset" to try to get it to play again but it wouldn't play more than once. I moved the create MediaPlayer to a function that is called on each button click. Like this:
Code: Select all
    public void playbuttonclick(){
       
       buttonclick = MediaPlayer.create(this,R.raw.click);
        buttonclick.start();
        buttonclick.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
           public void onCompletion(MediaPlayer buttonclick){          
              buttonclick.release();
          }});
          
    }

It plays the sound after each click now but the app crashes after clicking the buttons more than a dozen or so times. If I use buttonclick.reset it crashes even more quickly. So I can't create the MediaPlayer one time and use it again and again (it won't play more than once) AND I can't create it many times (it crashes the app).
I know I must be doing something wrong. What is it? Any ideas? Thanks.
ramgraph1
Experienced Developer
Experienced Developer
 
Posts: 68
Joined: Wed Jan 09, 2008 10:03 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Google [Bot] and 10 guests