Package lib :: Module dirty_io
[frames] | no frames]

Module dirty_io

source code

Classes
  BadChannel
Functions
gpkimgclass.gpk_img
wav_read(filename, channel=None, info={})
Quick and dirty way to read a single channel of audio from a multichannel file.
source code
 
splitname(filename)
Splits filenames in the form pathname[channel] into a pathname and a channel.
source code
 
wav_read2(filename)
Deal with filenames in the form path/name[channel].
source code
Variables
  NEARCLIP = 32500
  __package__ = 'lib'

Imports: re, numpy, die, wavio, NG


Function Details

wav_read(filename, channel=None, info={})

source code 

Quick and dirty way to read a single channel of audio from a multichannel file. If the channel is not specified, either as an argument or as info['Channel'], then it will pick whatever channel has the largest amplitude. Needless to say, this is not entirely reliable unless you know that the other channel is silent.

Parameters:
  • channel (string, int, or None.) - which channel to use? It can be a string name, an integer column number or None.
  • info (dict.) - a dictionary with miscellaneous metadata. info['Channel'] is inspected.
Returns: gpkimgclass.gpk_img
audio data with header information A gpk_img data structure holding the audio and header information. hdr['AudioChannel'], hdr['Trouble'] and hdr['WhyAudioChannel'] are set.
Raises:
  • BadChannel - when you ask for a channel that isn't there.

Note: Channel numbers start with zero!