UnwiredtecDocumentation : RingtoneCreatorServerErrorHandling

Error Handling and Output Codes


This chapter covers the result you get from Ringtone Creator Server and means of identifying whether conversion was successful or not and if not then why.

About 0.5% of thousands and thousands of ringtones our software has converted for our direct customers turned to be invalid due to multiple reasons: either the file format was specified incorrectly, or a transmission error occurred, or any other unpredictable thing happened. That's why you have to be prepared for the inevitable: some ringtones might not be converted because of slight problems with them.

Ringtone Creator Server provides capabilities to determine the status of conversion and provide the extra information needed for correct handing of resulting ringtones. Output from Ringtone Creator Server has the following structure:

<result_code>((<error_code><error_message>)|(<status_code>(<data>|<pcm-data>))<duration>)

Here:

<result_code> byte. Takes one of the following values:
FF – error, the error code and message follow;
00 – operation was successful
<error_code> byte. Represents an error (if any). Please refer to the <error_message> for details.
<error_message> plain-text (ISO-8859–1) error description. The list of error codes and messages follows:

Error Code: 1
Error Message: Either the filename or the format parameter must be specified
Solution: Please check your filename or format parameter values.

Error Code: 2
Error Message: Either the filename or the format parameter must be specified and be correct
Solution: Please check that either filename or format parameter has values.

Error Code: 3
Error Message: The ringtone contents must not be empty. forgotten about it.
Solution: Please check if you have put something into the ringtone parameter. Most likely, you\u2019ve forgotten about it.

Error Code: 4
Error Message: The ringtone must be encoded in the BASE64 format
Solution: Ringtone Creator Server requires incoming ringtones to be converted into the BASE64 format. Please provide your ringtone in BASE64 format. If you have troubles representing ringtones in this format, please ask us.

Error Code: 5
Error Message: Output format must be specified
Solution: The server has got what to do, but you haven't told it how you want to get the output. Please, don't confuse the server and assign some valid value to the outformat parameter.

Error Code: 6
Error Message: Invalid ringtone
Solution: The ringtone you provided couldn't be opened by our system. You may choose to ignore the error and take another ringtone or inform us about a problem.

Error Code: 7
Error Message: Error occurred during conversion. Please check the output format
Solution: Ringtone Creator Server has experienced some problem(s) in the process of converting a ringtone for you. Resolving this issue may require your personal attention.

Error Code: 8
Error Message: The ringtone doesn't contain PCM tracks
Solution: You tried to retrieve a PCM track from the ringtone which doesn't contain any. There's no solution.

Error Code: 9
Error Message: Invalid PCM sample number
Solution: You tried to retrieve a non-existing PCM sample. Please provide a valid PCM sample number.

Error Code: 10
Error Message: AUDIOFORMAT parser misconfigured
Solution: Please add a correct AUDIOFORMAT parser configuration to your server. You need to refer to Ringtone Creator Documentation for details.

Error Code: 11
Error Message: AUDIOFORMAT converter misconfigured
Solution: Please add a correct AUDIOFORMAT converter configuration to your server. You need to refer to Ringtone Creator Documentation for details.

Error Code: 12
Error Message: The output ringtone doesn't contain hearable notes
Solution: In certain cases the resulting ringtone (e.g. the one you get after conversion) is silent, and if you trim it, it will have a 0 ms duration. The ringtone you've provided can't be considered a good source for conversion.
<status_code> byte. Status code tells you about events you may be interested in.

00 – No messages. This event is unlikely if you're dealing with polyphonic ringtones
02 – channel truncation occurred. This means that the ringtone has lost some music data due to truncation of channels.
>10 – At least one PCM track is present in the original ringtone (as Ringtone Creator doesn't convert PCM tracks into note tracks [and no other tool can't as well], it has been removed from the output. Please issue the appropriate command to extract those PCM tracks). To get the number of tracks subtract 10 from the result. For example, if the status is 13, the number of PCM tracks is 3.

If more than 1 status is applicable, the first to occur is returned back.
<data> Byte array representing the resulting ringtone or an empty array (i.e. byte[0]).
<pcm-data> A text line in the following format:
format=x1;frequency=x2;basebit=x3;channel=x4;offset=x5;duration=x6;bytes=x7
Here:
  • format (x1)
    SIGNED
    ADPCM
    TVINVQ
    MP3
    unknown
  • frequency (x2)
    4
    8
    11,025
    22,05
    44,1
    unknown
  • basebit (x3)
    represents the number of bits for a single tick
  • channel (x4)
    takes one of the following values:
    mono
    poly
  • offset (x5)
    represents an offset (in ms) of the sample from the beginning of the melody.
  • duration (x6)
    represents the duration of the sample in ms.
  • bytes (x7)
    represents a PCM sample in a HEX-encoded form.
<duration> 4 bytes parameter representing the duration of a ringtone in milliseconds. It's the last parameter, so you can determine the size of the ringtone using the following formula:
[ringtone bytes] = [server response size] – [result code = 1 byte] [status code = 1 byte]

You can get the duration by calculating:
duration[0] << 24 + duration[1] << 16 + duration[2] << 8 + duration[3]

NOTE: if you don't want to get these four trailing bytes, please append the following parameter to your request:
&nolength=true