×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Jan 2006
    Posts
    3

    Converting sound from NOKIA API to standard API

    Hello~!

    I'm trying to convert a set of sounds which use the NOKIA API, to play them using standard MIDP 2.0 API methods, but I'm having a little trouble with the format...

    It seems that the sound is tone-based, and is played through the Sound class...

    Code:
    //Sound( byte []  data, int type );
    Sound sound = new Sound( soundBuffer, Sound.FORMAT_TONE );
    //of course, soundBuffer is a byte array containing the sound data
    I wish to convert it using the following methods:

    Code:
    Player p = Manager.createPlayer( Manager.TONE_DEVICE_LOCATOR );
    p.realize();
    
    ToneControl t = ( ToneControl )p.getControl( "ToneControl" );
    t.setSequence( soundBuffer );//not good! Sound format is incorrect?
    
    p.start();//hangs right after calling this method...
    My only problem is that I don't know the format in which the sound data (which is already provided to me) is stored in the byte array, thus, I can't reformat it to fit an appropriate sequence for toneControl...

    If anyone could point out to me the format in which the NOKIA Sound class expects the data in the byte array, that would be a huge help!

  2. #2
    Registered User
    Join Date
    Aug 2005
    Posts
    29

    Re: Converting sound from NOKIA API to standard API


  3. #3
    Registered User
    Join Date
    Jan 2006
    Posts
    3

    Re: Converting sound from NOKIA API to standard API

    Thanks for the link, even though I understand absolutely nothing... :P

    I'll go give it another read; in the meantime, if someone happens to have a version for dummies lying around somewhere, I'd greatly appreciate it -- with cookies, or something... Maybe...

    Seriously though, thanks!

    EDIT:

    OH-kay... I read some more, and apparently, all the data is squished into one continuous stream of bits!! I assume I'm gonna have to split the data according to the encoding values found in the array?!?

    I thought this would be easier...?

    Oh, boy... I hope I misunderstood that... =(
    Last edited by vagrantcharly; 2006-01-12 at 04:41.

  4. #4
    Registered User
    Join Date
    Aug 2005
    Posts
    29

    Re: Converting sound from NOKIA API to standard API

    Can you use;
    http://www.convert-ringtones.com/
    Is .nokia the format you want?

  5. #5
    Registered User
    Join Date
    Jan 2006
    Posts
    3

    Re: Converting sound from NOKIA API to standard API

    Quote Originally Posted by simonhayles
    Can you use;
    http://www.convert-ringtones.com/
    Is .nokia the format you want?
    I'm not entirely sure, I have this source code I need to convert, and only the sound is left... The (sound) resources are being loaded from a certain file, but I don't know exactly which format they're in, and I don't have any proper documentation on the source...

    If it sheds some light, here's the byte data for one of the sounds, I think it's compliant with the format specified in the first link you posted:

    Code:
    --- Data for Sound 0 ---
    --- Total bytes: 25 ---
    
    #	bin	hex
    0 : 0000 0010	02	//command-length?
    1 : 0100 1010	4A	//ringing-tone-programming?
    2 : 0011 1010	3A
    3 : 0100 0000	40
    4 : 0000 0100	04
    5 : 0000 0000	00
    6 : 0001 1111	1F
    7 : 0010 0100	24
    8 : 1100 0100	C4
    9 : 0001 1010	1A
    10: 1010 0010	A2
    11: 0100 1010	4A
    12: 1101 0001	D1
    13: 0000 0111	07
    14: 0010 1000	28
    15: 1001 0011	93
    16: 0001 0100	14
    17: 0010 0111	27
    18: 0100 0011	43
    19: 0101 0100	54
    20: 0010 1011	2B
    21: 0100 0101	45
    22: 0001 0011	13
    23: 1010 0000	A0
    24: 0000 0000	00

Similar Threads

  1. Problem in Interjection of Sound in Live Voice Call on Nokia 6620
    By bajwa_78 in forum Symbian Media (Closed)
    Replies: 13
    Last Post: 2005-09-30, 09:17
  2. Infra-red capability
    By Symbian_Challenge_0412 in forum General Development Questions
    Replies: 1
    Last Post: 2005-08-16, 18:24
  3. Standard sound (nokia 7650 an rest), duration = 3000 and sound is short, why ?
    By robon in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2003-07-22, 09:51
  4. Nokia sound API.... game freezes at variable intervals
    By shahzad73 in forum Mobile Java General
    Replies: 0
    Last Post: 1970-01-01, 02: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
  •  
×