×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Sep 2009
    Posts
    5

    Generating a Sound

    I posted a few days ago about a project I'm working on in which the phone receives data in the form of integers from a sensor. This data is then conveyed using vibration feedback. As another form of feedback, I would like to generate a sound depending on the data received - either a difference in frequency or volume.

    I've done some searching around the wiki and boards, and tried out code, but it doesn't seem to work.

    I found a piece of code on the Sun site, and changed it a bit for my program.

    Code:
    try {
                Manager.playTone(ToneControl.C4, 4000, 400);
                status = "Playing.";
            } catch (MediaException me) {
                status = "Failed.";
            }
    In the emulator, it plays a brief tone (less than a second) even though the code says it should play for 4 seconds. When I put it on my phone, I don't get any sound. Status is written on every repaint, which happens right after this block. It always says "Playing.".

    I'm testing this on a phone (S60E5) with earphones plugged in, and the sound works fine for everything else. I've also tested it on another phone (S40) and had the same issue.

    Are there other methods I can use to generate a tone, or has anyone got any ideas why this isn't working?
    Last edited by syncosised; 2010-02-10 at 13:42.

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Generating a Sound

    A common issue on Series 60 is having the "warning sounds" switched off in the currect ringer profile.

    Graham.

  3. #3
    Registered User
    Join Date
    Sep 2009
    Posts
    5

    Re: Generating a Sound

    Wow, that seems so obvious now, but I never thought of it! My phone never leaves silent, so I didn't think of changing it at all. It works perfectly now, thanks a million!

Similar Threads

  1. Problem with Sound class getState()
    By creepymo in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2005-06-20, 18:43
  2. MIDI Sound problem (J2ME / Series 60)
    By JPapke in forum Mobile Java Media (Graphics & Sounds)
    Replies: 2
    Last Post: 2004-10-29, 08:17
  3. Sound in Midp 2.0 stalls
    By astraton2001 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 4
    Last Post: 2004-03-25, 06:58
  4. sound bug (possibly) on 6610
    By alex_crowther in forum Mobile Java Media (Graphics & Sounds)
    Replies: 2
    Last Post: 2004-02-05, 11:44
  5. Nokia Smart Expert - solve this sound problem
    By tsoh_tan in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2003-10-30, 04:36

Posting Permissions

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