Module conversions
[hide private]
[frames] | no frames]

Module conversions

source code

Routines to do various file format conversions

Classes [hide private]
  ConversionFailed
Functions [hide private]
 
shortfilename(x) source code
 
gethelperbinary(basename)
Returns the full pathname to the specified helper binary
source code
 
getpvconvbinary()
PVConv can't be distributed with BitPim so the user has to install it and we have to find it
source code
 
_expand(x) source code
 
run(*args)
Runs the specified command (args[0]) with supplied parameters.
source code
 
convertto8bitpng(pngdata, maxsize)
Convert a PNG file to 8bit color map
source code
 
convertto8bitpng_joe(pngdata)
Convert a PNG file to 8bit color map
source code
 
converttomp3(inputfilename, bitrate, samplerate, channels)
Reads inputfilename and returns data for an mp3 conversion
source code
 
converttowav(mp3filename, wavfilename, samplerate=None, channels=None, start=None, duration=None) source code
 
convertwavtoqcp(wavfile, qcpfile, optimization=None) source code
 
convertqcptowav(qcpfile, wavfile) source code
 
adjustwavfilevolume(wavfilename, gain)
Ajdust the volume of a wav file.
source code
 
trimwavfile(wavfilename, wavoutfilename, start, duration=None, gain=None) source code
 
trimwavdata(wavedatain, start, duration=None) source code
 
convertjpgtoavi(jpg_data, avi_file_name, fps=4, new_file=False) source code
 
convertavitobmp(avi_data, frame_num=0) source code
 
convertfileavitobmp(avi_file_name, frame_num=0) source code
 
convertfilelgbittobmp(bit_file_name)
File-based wrapper for convertlgbittobmp.
source code
 
convertlgbittobmp(bit_data)
Takes a BIT image file (LG proprietary) and returns BMP
source code
 
convertbmptolgbit(bmp_data)
Takes a BMP image file and returns BIT image file (LG proprietary)
source code
 
helperavailable(helper_name) source code
Variables [hide private]
  helperdir = 'c:\\projects\\helpers'
  osext = '.exe'
  _foundpvconv = None
  _qcp_optimization_params = ('ffr', 'vfr', 'fhr', 'vhr')
Function Details [hide private]

run(*args)

source code 

Runs the specified command (args[0]) with supplied parameters. Note that your path is not searched for the command.

converttomp3(inputfilename, bitrate, samplerate, channels)

source code 

Reads inputfilename and returns data for an mp3 conversion

Parameters:
  • bitrate - bitrate to use in khz (ie 16 is 16000 bits per second)
  • samplerate - audio sampling rate in Hertz
  • channels - 1 is mono, 2 is stereo

convertlgbittobmp(bit_data)

source code 

Takes a BIT image file (LG proprietary) and returns BMP

Parameters:
  • bit_data - 16BPP BIT image file data
Returns:
24BPP BMP image file data

convertbmptolgbit(bmp_data)

source code 

Takes a BMP image file and returns BIT image file (LG proprietary)

Parameters:
  • bit_data - 8BPP or 24BPP BMP image file data
Returns:
16BPP LGBIT image file data