locked
Set Ringtone RRS feed

  • Question

  • Hi,

    Hey my problem is that i want to set the mp3 file as ringtone from my application. 

    Can u plz help me.

     

    Thanks.    

    Saturday, May 15, 2010 7:28 AM

Answers

All replies

  • You need to set the path of Your ringtone in the registry.
    You can find it under: HKCU\ControlPanel\Sounds\RingTone0 in either Sound or SavedSound values (both are strings and depend on WM version).

    If You'll find my answer satisfactory or helpful - mark it as answered or vote for it! Thank You.

    I'm on MSDN just like MD House in the clinic. But I'm also a human which sometimes needs to see another doctor :)

    After 3 years of WiMo developement - now switching to BadaOS. So long WM's lack of everything, welcome fully fledged Bada SDK :D.
    • Proposed as answer by Mal Loth Saturday, May 15, 2010 8:59 AM
    Saturday, May 15, 2010 8:59 AM
  • Hi Mal

     Thanks For your replay.

    Can you plz can plz give me the code for it so i can usnderstand.bcz i haved tried it but it not work.

     

    Thanks 

    Saturday, May 15, 2010 10:17 AM
  • In C#:

    Registry.SetValue("HKEY_CURRENT_USER\\Sounds\\RingTone0", "Sound", "\\Windows\\test.mp3");
    
    Registry.SetValue("HKEY_CURRENT_USER\\Sounds\\RingTone0", "SavedSound", "\\Windows\\test.mp3");

    In C++:

    HKEY key;
    LPSTR path = "\\Windows\\test.mp3";
    RegOpenKeyEx(HKEY_CURRENT_USER, L"Sounds\\RingTone0", 0, 0, &key);
    RegSetValueEx(key, L"Sound", 0, REG_SZ, (LPBYTE)path, strlen(path));
    RegSetValueEx(key, L"SavedSound", 0, REG_SZ, (LPBYTE)path, strlen(path));
    RegCloseKey(key);

    I hope You don't mind that I used ASCII variable in path instead of the UNICODE, but it's faster that way, if You don't use UNICODE path.

    In some cases You will need to place the file in \Windows directory and just write its name instead of full path in the registry ("test.mp3" instead of "\\Windows\\test.mp3").


    If You'll find my answer satisfactory or helpful - mark it as answered or vote for it! Thank You.

    I'm on MSDN just like MD House in the clinic. But I'm also a human which sometimes needs to see another doctor :)

    After 3 years of WiMo developement - now switching to Bada OS.
    So long WM's lack of everything, welcome fully fledged Bada SDK :D.
    • Proposed as answer by Mal Loth Saturday, May 15, 2010 10:56 AM
    Saturday, May 15, 2010 10:56 AM
  • Hi Mal.

    Thanks for thereplay.i tried this bt it will not work.

    any thing else we need to do for this.like updating registry or anythig else.

     

    Thanks, 

    Saturday, May 15, 2010 12:00 PM
  • Soft reset? Changing file format to .wav or .wma?
    If You'll find my answer satisfactory or helpful - mark it as answered or vote for it! Thank You.

    I'm on MSDN just like MD House in the clinic. But I'm also a human which sometimes needs to see another doctor :)

    After 3 years of WiMo developement - now switching to Bada OS.
    So long WM's lack of everything, welcome fully fledged Bada SDK :D.
    Saturday, May 15, 2010 12:09 PM
  • You can try this.

     

    using Microsoft.WindowsMobile.PocketOutlook;

     

    OutlookSession outlookSession = new OutlookSession();

     Contact contact = new Contact();
                                contact.FirstName = textBoxFirstName.Text;
                                contact.LastName = textBoxLastName.Text;
                                contact.MobileTelephoneNumber = textBoxMobileNumber.Text;
                                contact.RingTone = "testSound.wav";
                                outlookSession.Contacts.Items.Add(contact);

     

    Hope this help


    KSD
    Saturday, May 15, 2010 6:20 PM
  • Hi Mal,

    Hey i Chage the format .wav its its not get chaged.can u tel me wht i can do now.

    And wht do you mean by soft reset??

    Thanks.

    Monday, May 17, 2010 4:54 AM
  • Hi Niks,

    Soft reset will reload the registry data. Please check whether you can play the sound file with media player. If not, please change ringtone sound file, which is workable in media player.

     

    Best regards,
    Guang-Ming Bian - MSFT


    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    Tuesday, May 18, 2010 3:47 AM
  • Hi Guang,

    Thanks for your replay.i check the file its played in media player.but its not get set as ringtone.the defult ringtone only  get played.have anu other solution for this.

    Hey and  last time u told me u teach how to work with transparency and animation on Windows Mobile.can u teach me hw i can do this in windows phone.

    Thanks. 

    Tuesday, May 18, 2010 4:56 AM
  • Hi Niks,

    Firstly do you soft reset your device to check whether ringtone works?

     

    Secondly, can you show the thread link about transparency issue?

     

     

    Best regards,
    Guang-Ming Bian - MSFT


    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    Tuesday, May 18, 2010 5:50 AM
  • Hi Guang,

    I do the soft Reset.bt still the ringtone is not get set. 

    below is thred link for transparency

    http://social.msdn.microsoft.com/Forums/en-US/windowsmobiledev/thread/df07add1-9c98-494d-8bae-16855c783ad0

     

     

     

    • Marked as answer by Niks 86 Thursday, June 3, 2010 3:58 AM
    Tuesday, May 18, 2010 6:49 AM