×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Feb 2007
    Posts
    17

    Playing Sound jsr 135 problem need help :)

    i have an application which does lot of code behind work and on certain events i have to play a certain sound .. i used j2r 135 specification to play sound and it playes perfectly.

    But when i integrated this module with my application which does lot of processing in the background , the sound breaks!! playert.start() isnt itself a thread? do i need to do any multithreading .. (note: Its in Emulator eniviroment i havent tested on device yet)!!

  2. #2
    Registered User
    Join Date
    Feb 2007
    Posts
    17

    Re: Playing Sound jsr 135 problem need help :)

    The function below is called when there is a specific event!! ..
    I even tried doing createPlayer and realize and prefetch() before calling this function but the sounds breaks badly ...


    public void playSchoolZoneSound()
    {
    try
    {
    InputStream inputStream = getClass().getResourceAsStream("/schoolzoneactive.wav");
    iPlayerSchoolZone = Manager.createPlayer(inputStream,"audio/X-wav");
    iPlayerSchoolZone.addPlayerListener(this);
    iPlayerSchoolZone.realize();
    iPlayerSchoolZone.prefetch();
    iPlayerSchoolZone.start();
    }
    catch (MediaException ex)
    {

    }
    catch(IOException ioexception)
    {

    }
    }

  3. #3
    Registered User
    Join Date
    Feb 2007
    Posts
    17

    Re: Playing Sound jsr 135 problem need help :)

    Harrti? Any idea"?

  4. #4
    Registered User
    Join Date
    Jun 2007
    Posts
    4

    Re: Playing Sound jsr 135 problem need help :)

    Hi,

    I have been developing recently with 135 specification and I have found that when there is a lot of work is better to use another thread to play sound (although I think the player uses its own thread ....)

    Another thing that could be your problem is the duration of the buffer to be played. Sometimes when I play a buffer too long there is some breaks as if the whole track was being cut in little tracks to reproduce.

    Regards

  5. #5
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: Playing Sound jsr 135 problem need help :)

    Nice to have people trusting me to answer the questions in here :-)
    in this case javierclaveria's answer is as good as any, please use threads in your application.

    Also note that I am not on these boards 24/7, I do not know anyone who is. This means that getting a response will generally take more time than a few hours even though there are people contributing in here from different timezones.
    (And during the weekends expect a few days to get any answers...)

    Hartti

  6. #6
    Registered User
    Join Date
    Feb 2007
    Posts
    17

    Re: Playing Sound jsr 135 problem need help :)

    Thanks Javier and Hartti .. I thought same solution to it.. but when I installed the whole integrated application on the Device it just works perfectly fine! But on Emulator it breaks! Strange and is in emulator it should perform better because it has the more memory and processing power than the device.. When it works well on device i dont see any reason to implement multi threading!

    What is you suggestion Javier and Hartti!

Similar Threads

  1. problem when stop playing video on 3650 and try to play again
    By niko86 in forum Mobile Java General
    Replies: 5
    Last Post: 2007-08-03, 07:40
  2. N90 mysterious sound fading problem
    By greatape in forum Symbian Media (Closed)
    Replies: 0
    Last Post: 2006-08-23, 07:57
  3. nokiaUI sound problem with MIDP 1.0 on Ngage
    By iLya in forum Mobile Java General
    Replies: 1
    Last Post: 2005-07-05, 02:41
  4. AMR sound problem in 3650 & 6600
    By ankur_k in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2004-01-21, 14:44
  5. Problem on playing sound in emulator
    By mhahn0106 in forum Symbian Tools & SDKs
    Replies: 0
    Last Post: 2004-01-12, 06:00

Posting Permissions

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