- Main Page
- Namespaces
- Classes
- Files
- Directories
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# Exponent::Audio::TAudioFile< TypeName > Class Template Reference

Inheritance diagram for Exponent::Audio::TAudioFile< TypeName >:

List of all members.

## Detailed Description

### template<class TypeName>
class Exponent::Audio::TAudioFile< TypeName >

A representation of an audio file.

Date:
  14/12/2006

Author:
  Paul Chana

Version:
  1.0.0 Initial version

Note:
  All contents of this source code are copyright 2005 Exp Digital Uk.
  This source file is covered by the licence conditions of the Infinity API. You should have recieved a copy
  with the source code. If you didnt, please refer to http://www.expdigital.co.uk All content is the Intellectual property of Exp Digital Uk.
  Certain sections of this code may come from other sources. They are credited where applicable.
  If you have comments, suggestions or bug reports please visit http://support.expdigital.co.uk

Id
  TAudioFile.hpp,v 1.3 2007/02/08 21:08:09 paul Exp

Definition at line 34 of file TAudioFile.hpp.

## Public Member Functions

- const TAudioBuffer< TypeName > * getAudioBuffer () const
- TAudioBuffer< TypeName > * getMutableAudioBuffer ()
- bool readFile (const CSystemString &filename)
- TAudioFile ()
- bool writeFile (const CSystemString &filename, const unsigned long bitDepth, const unsigned long sampleRate, TAudioBuffer< TypeName > &buffer)
- bool writeFile (const CSystemString &filename, const unsigned long bitDepth, const unsigned long sampleRate)
- virtual ~TAudioFile ()

## Protected Attributes

- TAudioBuffer< TypeName > m_audioBuffer

## Constructor & Destructor Documentation

template<class TypeName>

Exponent::Audio::TAudioFile< TypeName >::TAudioFile | ( |  | ) | `[inline]`

Construction

Definition at line 49 of file TAudioFile.hpp.

References EXPONENT_CLASS_CONSTRUCTION.

template<class TypeName>

virtual Exponent::Audio::TAudioFile< TypeName >::~TAudioFile | ( |  | ) | `[inline, virtual]`

Destruction

Definition at line 57 of file TAudioFile.hpp.

References EXPONENT_CLASS_DESTRUCTION.

## Member Function Documentation

template<class TypeName>

const TAudioBuffer<TypeName>* Exponent::Audio::TAudioFile< TypeName >::getAudioBuffer | ( |  | ) | const`[inline]`

Get the audio buffer

Return values:

  | const | TAudioBuffer<TypeName>* The audio buffer

Definition at line 68 of file TAudioFile.hpp.

References Exponent::Audio::TAudioFile< TypeName >::m_audioBuffer.

template<class TypeName>

TAudioBuffer<TypeName>* Exponent::Audio::TAudioFile< TypeName >::getMutableAudioBuffer | ( |  | ) | `[inline]`

Get the audio buffer

Return values:

  | TAudioBuffer<TypeName>* | The audio buffer

Definition at line 74 of file TAudioFile.hpp.

References Exponent::Audio::TAudioFile< TypeName >::m_audioBuffer.

template<class TypeName>

bool Exponent::Audio::TAudioFile< TypeName >::readFile | ( | const CSystemString & | filename | ) | `[inline]`

Read the file

Parameters:

  | filename | The name of the file

Return values:

  | bool | True if loaded properly, false otherwise

Definition at line 83 of file TAudioFile.hpp.

References Exponent::Audio::TAiffFileFormat< TypeName >::isValidFormat(), Exponent::Audio::TWaveFileFormat< TypeName >::isValidFormat(), Exponent::Audio::TAudioFile< TypeName >::m_audioBuffer, Exponent::Audio::TAiffFileFormat< TypeName >::openFile(), Exponent::Audio::TWaveFileFormat< TypeName >::openFile(), Exponent::Audio::TAiffFileFormat< TypeName >::readData(), Exponent::Audio::TWaveFileFormat< TypeName >::readData(), Exponent::Audio::TAiffFileFormat< TypeName >::readHeader(), and Exponent::Audio::TWaveFileFormat< TypeName >::readHeader().

template<class TypeName>

bool Exponent::Audio::TAudioFile< TypeName >::writeFile | ( | const CSystemString & | filename,
|  | const unsigned long | bitDepth,
|  | const unsigned long | sampleRate,
|  | TAudioBuffer< TypeName > & | buffer |
| ) |  |  | `[inline]`

Write the file

Parameters:

  | filename | The name of the file to write
  | bitDepth | 8/16/24
  | sampleRate | The sample rate to write at
  | buffer | The buffer to write

Return values:

  | bool | True if written properly, false otherwise

Note:
  This currently only writes wave files

Definition at line 164 of file TAudioFile.hpp.

References Exponent::Audio::TAudioBuffer< TypeName >::getNumberOfChannels(), Exponent::Audio::TAudioBuffer< TypeName >::getNumberOfSamples(), Exponent::Audio::TWaveFileFormat< TypeName >::m_bitDepth, Exponent::Audio::TWaveFileFormat< TypeName >::openFile(), Exponent::Audio::TWaveFileFormat< TypeName >::writeData(), and Exponent::Audio::TWaveFileFormat< TypeName >::writeHeader().

template<class TypeName>

bool Exponent::Audio::TAudioFile< TypeName >::writeFile | ( | const CSystemString & | filename,
|  | const unsigned long | bitDepth,
|  | const unsigned long | sampleRate |
| ) |  |  | `[inline]`

Write the file

Parameters:

  | filename | The name of the file to write
  | bitDepth | 8/16/24
  | sampleRate | The sample rate to write at

Return values:

  | bool | True if written properly, false otherwise

Note:
  This currently only writes wave files

Definition at line 150 of file TAudioFile.hpp.

References Exponent::Audio::TAudioFile< TypeName >::m_audioBuffer.

## Member Data Documentation

template<class TypeName>

TAudioBuffer<TypeName> Exponent::Audio::TAudioFile< TypeName >::m_audioBuffer`[protected]`

The audio buffer that we write to

Definition at line 207 of file TAudioFile.hpp.

Referenced by Exponent::Audio::TAudioFile< TypeName >::getAudioBuffer(), Exponent::Audio::TAudioFile< TypeName >::getMutableAudioBuffer(), Exponent::Audio::TAudioFile< TypeName >::readFile(), and Exponent::Audio::TAudioFile< TypeName >::writeFile().