SLIP  1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Attributes | List of all members
slip::WavReader< Container1d, T, Nb_block > Class Template Reference

WavReader, inherited from ContainerReader, is a reader for wav audio files. More...

#include <WavReader.hpp>

Inheritance diagram for slip::WavReader< Container1d, T, Nb_block >:
Inheritance graph

Public Types

typedef Container1d container_type
 
typedef T value_type
 
typedef ContainerReader
< Container1d, T, Nb_block > 
base
 

Public Member Functions

void initialize ()
 initialized the reading process. More...
 
void release ()
 release the reading process. More...
 
int read (container_type &in)
 virtual read function. If Nb_block is more than one, it reads only one container, and returns 0. Else it reads the container and returns 1. If the file data_filename has been completely read (no more block to read), it returns 1. More...
 
std::size_t get_output_size () const
 Get the output signal size. More...
 
const WAVE_HEADER & get_header () const
 Get the wav file header. More...
 
Constructors & Destructors
 WavReader ()
 
 WavReader (std::string data_filename)
 
virtual ~WavReader ()
 
Getters and setters
const std::string & get_data_filename () const
 return the name of the file containing the data to read More...
 
void set_data_filename (const std::string &data_filename)
 
std::size_t get_nb_block () const
 return the number of splitting blocks of the data More...
 

Protected Attributes

std::string data_filename_
 

Detailed Description

template<class Container1d, typename T, std::size_t Nb_block>
class slip::WavReader< Container1d, T, Nb_block >

WavReader, inherited from ContainerReader, is a reader for wav audio files.

Version
Fluex 1.0
Date
2013/04/15
Author
Denis Arrivault <denis.arrivault_AT_inria.fr>
Parameters
Container1dshould be a 1d Container with only one component.
Tthe type of the container data.
Nb_blockis the number of containers to create (>1 if one want to split the input data into different containers, default is 1).
Precondition
The audio signal should be a mono signal. If it is not, only the first channel is read.
Note
It is assumed that there is at most 32 bits per samples
Examples:
wav_file_io.cpp.

Definition at line 37 of file WavReader.hpp.

Member Typedef Documentation

template<class Container1d, typename T, std::size_t Nb_block>
typedef ContainerReader<Container1d,T,Nb_block> slip::WavReader< Container1d, T, Nb_block >::base

Definition at line 41 of file WavReader.hpp.

template<class Container1d, typename T, std::size_t Nb_block>
typedef Container1d slip::WavReader< Container1d, T, Nb_block >::container_type

Definition at line 39 of file WavReader.hpp.

template<class Container1d, typename T, std::size_t Nb_block>
typedef T slip::WavReader< Container1d, T, Nb_block >::value_type

Definition at line 40 of file WavReader.hpp.

Constructor & Destructor Documentation

template<class Container1d, typename T, std::size_t Nb_block>
slip::WavReader< Container1d, T, Nb_block >::WavReader ( )
inline

Default constructor

Definition at line 51 of file WavReader.hpp.

template<class Container1d, typename T, std::size_t Nb_block>
slip::WavReader< Container1d, T, Nb_block >::WavReader ( std::string  data_filename)
inline

Constructor with parameters.

Parameters
data_filenameis the name of the file containing the data to read
Note
this constructor automatically call the initialize() method.

Definition at line 62 of file WavReader.hpp.

template<class Container1d, typename T, std::size_t Nb_block>
virtual slip::WavReader< Container1d, T, Nb_block >::~WavReader ( )
inlinevirtual

Destructor

Note
the release() method is called.

Definition at line 72 of file WavReader.hpp.

Member Function Documentation

const std::string& slip::ContainerReader< Container1d , T, Nb_block >::get_data_filename ( ) const
inherited

return the name of the file containing the data to read

template<class Container1d, typename T, std::size_t Nb_block>
const WAVE_HEADER& slip::WavReader< Container1d, T, Nb_block >::get_header ( ) const
inline

Get the wav file header.

Returns
the wav file header

Definition at line 117 of file WavReader.hpp.

std::size_t slip::ContainerReader< Container1d , T, Nb_block >::get_nb_block ( ) const
inherited

return the number of splitting blocks of the data

template<class Container1d, typename T, std::size_t Nb_block>
std::size_t slip::WavReader< Container1d, T, Nb_block >::get_output_size ( ) const
inline

Get the output signal size.

Returns
the signal size

Definition at line 110 of file WavReader.hpp.

template<class Container1d , typename T , std::size_t Nb_block>
void slip::WavReader< Container1d, T, Nb_block >::initialize ( )
inline

initialized the reading process.

Note
an initialization is called by the WavReader(std::string) constructor.

Definition at line 151 of file WavReader.hpp.

template<class Container1d , typename T , std::size_t Nb_block>
int slip::WavReader< Container1d, T, Nb_block >::read ( container_type in)
virtual

virtual read function. If Nb_block is more than one, it reads only one container, and returns 0. Else it reads the container and returns 1. If the file data_filename has been completely read (no more block to read), it returns 1.

Parameters
inis the container to fill. Warning, the container should be a 1d container with [] operator, resize() and size() methods defined.
Returns
true if there is still data to read, false if the file has been completely read.
Precondition
The audio signal should be a mono signal. If it is not, only the first channel is read.
Note
It is assumed that there is at most 32 bits per samples

Implements slip::ContainerReader< Container1d, T, Nb_block >.

Definition at line 278 of file WavReader.hpp.

template<class Container1d , typename T , std::size_t Nb_block>
void slip::WavReader< Container1d, T, Nb_block >::release ( )

release the reading process.

Note
this method is called by the destructor.

Definition at line 388 of file WavReader.hpp.

void slip::ContainerReader< Container1d , T, Nb_block >::set_data_filename ( const std::string &  data_filename)
inherited
Parameters
data_filenameis the name of the file containing the data to read

Member Data Documentation

std::string slip::ContainerReader< Container1d , T, Nb_block >::data_filename_
protectedinherited

Definition at line 100 of file ContainerReader.hpp.


The documentation for this class was generated from the following file: