×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Feb 2014
    Posts
    1

    pitch control not working?

    I have successfully recorded and played the sound but when
    I am trying to change pitch of audio, pitch control is showing null pointer exception.
    what am I suppose to do?
    my motive is to record sound and play it with increased pitch.
    code is:-
    HTML Code:
     public void play(){
                 try {
                            Player player=Manager.createPlayer(new ByteArrayInputStream((output).toByteArray()),"audio/wav");
                            player.realize();
                            player.prefetch();
                            VolumeControl volume=(VolumeControl)player.getControl("VolumeControl");
                            volume.setLevel(100);
                            PitchControl pc=(PitchControl)player.getControl("javax.microedition.media.control.PitchControl");
                            pc.setPitch(1000);
                            player.start();
                            str="play.........";
                            repaint();
                      } catch (Exception e) {
                            System.out.println(e);
                      }
    
            
        }
    I have taking help form following links:-
    http://books.google.co.in/books?id=t...a%20me&f=false
    http://developer.nokia.com/community...anging-in-j2me
    http://www.java2s.com/Tutorial/Java/...llableMIDI.htm
    http://www.oracle.com/technetwork/sy...ew-155596.html

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,689

    Re: pitch control not working?

    You may want to check if pc happens to be null. It is more likely that the control is simply not supported than it raises some internal null pointer exception.
    Actually the second link you have posted says the same.

Similar Threads

  1. Map Control Pitch Issue
    By raananan in forum Maps API for Windows Phone
    Replies: 3
    Last Post: 2013-05-20, 13:21
  2. set pitch
    By rony_sha in forum Mobile Java Media (Graphics & Sounds)
    Replies: 3
    Last Post: 2010-05-14, 10:04
  3. How to pitch a concept?
    By ryn004 in forum General Development Questions
    Replies: 0
    Last Post: 2009-11-30, 22:11
  4. x-pitch and y-pitch
    By alcopops in forum Symbian Media (Closed)
    Replies: 0
    Last Post: 2005-12-16, 14:44
  5. x and y pitch
    By alcopops in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2005-12-16, 14:43

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×