UnwiredtecDocumentation: RingtoneCreatorJavaSizesChange ...

Product Documentation | Page Index | Access deniedRecent Changes | Recently Commented | Users | Registration | Login:  Password:  

Changing Ringtone Sizes


To make a ringtone fit the SMS size or just to limit the number of notes in a ringtone, you can use the following methods of a Ringtone class:


public Ringtone truncate(int noteLimit);

This method truncates a ringtone setting the maximum number of notes and throwing off the excessive notes. For polyphonic ringtones this method also aligns the duration of each track by the channel it considers to contain the lead melody. NOT applicable to WAV, MP3, AMR, SMAF with PCM samples.

public Ringtone limit(int sizeLimit);

This method truncates (see above) the ringtone to the number of notes that can be contained in a MIDI 1 file of the given size. I.e. if you limit the size by 2000 bytes, this method will return a ringtone, which, being saved as a MIDI 1 file, will be approximately 2000 bytes of size. NOT applicable to WAV, MP3, AMR, SMAF with PCM samples.

public Ringtone limit(String format, int maxBytes);

For a given format (it may also include processing options) specify the maximum number of bytes a current ringtone will not exceed. Extremely useful when you impose strict size limitations on the ringtones.

public Ringtone truncateChannels(int channelsCount);

This method truncates (see above) the ringtone to the number of MIDI channels (thus it's applicable only for Polyphonic ringtones and does nothing in case of monophonic ringtones). It leaves the first channelCount number of monophonic channels according either to the SP-MIDI MIP table, or to the order of channels in a flat SP-MIDI file. NOT applicable to WAV, MP3, AMR as they are considered to consist of 1 channel (nothing to do with mono / stereo, though).

public Ringtone limitTime(int time);

In some countries there's a limitation on the duration of a ringtone transmitted to a mobile device. This method allows setting the maximum duration of a ringtone in milliseconds in order to comply with the local regulations or just to provide a sample of a ringtone.

public Ringtone limitTime(int startTime, int endTime);

Get the fragment of a melody contained between startTime and endTime (both in ms). If there's no music information in this time range, the resulting ringtone will be empty.

public int getDuration();

Returns the duration (in ms) of a ringtone. Applicable for polyphonic, monophonic and PCM ringtones.

public int getDuration(boolean pcmOnly);

Returns the duration (in ms) of a PCM (if pcmOnly is true) or a note (otherwise) part of a ringtone. Applicable for polyphonic, monophonic and PCM ringtones.

public Ringtone trim();

Removes pauses in the beginning and at the end of the melody.


 
There are no files on this page. [Display files/form]
There is no comment on this page. [Display comments/form]