×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Dec 2008
    Posts
    33

    Post problem in playing audio

    Dear all,
    I wrote the following code for playing audio by emulator from PC.
    Code:
    if(command == play)
    {
                try
                {   
                    byte[] b = new byte[1000];
                    InputStream is  = getClass().getResourceAsStream("K.wav");
                    is.read(b);
                    ByteArrayInputStream bais = new ByteArrayInputStream(b);
                    Player p = Manager.createPlayer(bais, "audio/x-wav");
                    p.start();
                }
                catch(Exception e)
                {}
           }
    I have the following problem :
    ** Let I run K.wav first for multiple times by play comand and then close emulator.
    ** Then I went to play say a.wav samely just changing into the code.
    ** When I want to play a.wav for multiple times then sometimes K.wav is also played instead of a.wav.
    ** This is happening when I am using byte[] and BytaArrayInputStream.
    ** But if I use only InputStream like,

    Code:
      InputStream is  = getClass().getResourceAsStream("K.wav");        
      Player p = Manager.createPlayer(is, "audio/x-wav");
      p.start();
    then everything OK. but I need both byte[] and ByteArrayInputStream.

    So, how can I solve this problem? I need urgent help. Thanks in advance.

    Regards,
    Prithwi.

  2. #2
    Super Contributor
    Join Date
    Feb 2006
    Posts
    689

    Re: problem in playing audio

    Hi,
    Once you stop playing,use deallocate() method to deallocate resources before you play the next file.Also make sure is==null before you get the insput stream.

    Thanks
    soku

  3. #3
    Registered User
    Join Date
    Apr 2009
    Posts
    2

    Re: problem in playing audio

    while playing *.wav files the navigation in menu and internet surfing make holes in sound. the quality of wav is good enough to listen it with mobile. would you mind making some corrections in firmware to fix this shit?

  4. #4
    Registered User
    Join Date
    Apr 2009
    Posts
    2

    Re: problem in playing audio

    also i'd like to have a possibility to listen to lossless formats with the device (N95 8gb)

Similar Threads

  1. KErrOverflow (-9) during playing a long audio with APS
    By paipeng in forum Symbian Media (Closed)
    Replies: 1
    Last Post: 2008-08-28, 18:13
  2. Audio playing over RTP on 6600 and 6620.
    By ravinathwani in forum Symbian Media (Closed)
    Replies: 5
    Last Post: 2008-05-24, 09:49
  3. Video with audio recording delay problem on N90
    By vasya0 in forum Symbian Media (Closed)
    Replies: 2
    Last Post: 2007-12-03, 16:44
  4. 3500 (s40) playing audio problem
    By ahmadi2c in forum Mobile Java General
    Replies: 2
    Last Post: 2007-03-07, 08:03
  5. Replies: 7
    Last Post: 2007-02-07, 18:12

Posting Permissions

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