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

Module exp_collection

source code

This module contains code for collecting experimental data. It uses the pygame module to give us a reasonably nice GUI.

This software is copyright Greg Kochanski (2010) and is available under the Lesser Gnu Public License, version 3 or higher. It was funded by the UK's Economic and Social Research Council under project RES-062-23-1323. This is available from http://sourceforge.org/projects/speechresearch, http://kochanski.org/gpk/papers/2010/aesop_data_collect, and http://www.phon.ox.ac.uk/files/releases/2008aesopus2_data_collect.tar

Classes [hide private]
  ProgressBar
This is a general-purpose progress bar for GTK that extends horizontally.
  experiment_base
This class is intended to be the basis of a finite-state machine description of the experiment.
  GUI_base
Base class for the data-collection graphical user interface.
Functions [hide private]
 
drop_blanks(s) source code
list
wav_peak(fn, tstart=None, t_end=None)
This function checks that a WAV file is legal, and returns the peak amplitude for each column, relative to the largest possible amplitude.
source code
 
check_wav(fn, gui)
This checks a wav file and displays its peak amplitude.
source code
 
get_text(s)
Pull text from a named file.
source code
 
set_defaults(d, **kv)
Set a value into dictionary d only if there is nothing there already.
source code
Variables [hide private]
  _sizes = {2: (<type 'numpy.int16'>, 16, 32767), 4: (<type 'num...
  _get_text_cache = {}
  __package__ = None
Function Details [hide private]

wav_peak(fn, tstart=None, t_end=None)

source code 

This function checks that a WAV file is legal, and returns the peak amplitude for each column, relative to the largest possible amplitude.

Parameters:
  • fn (str) - filename
  • tstart (float) - where to start in the file
  • t_end (float) - where to start in the file
Returns: list
list of peak amplitudes, one for each column.

set_defaults(d, **kv)

source code 

Set a value into dictionary d only if there is nothing there already.

Parameters:
  • d (dict) - dictionary to be updated
  • kv (dict) - dictionary of default values

Variables Details [hide private]

_sizes

Value:
{2: (<type 'numpy.int16'>, 16, 32767),
 4: (<type 'numpy.int32'>, 32, 2147483647)}