2 * $Id: AUD_SndFileWriter.h 39792 2011-08-30 09:15:55Z nexyon $
4 * ***** BEGIN GPL LICENSE BLOCK *****
6 * Copyright 2009-2011 Jörg Hermann Müller
8 * This file is part of AudaSpace.
10 * Audaspace is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * AudaSpace is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with Audaspace; if not, write to the Free Software Foundation,
22 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 * ***** END GPL LICENSE BLOCK *****
27 /** \file audaspace/sndfile/AUD_SndFileWriter.h
32 #ifndef AUD_SNDFILEWRITER
33 #define AUD_SNDFILEWRITER
35 #include "AUD_IWriter.h"
41 * This class writes a sound file via libsndfile.
43 class AUD_SndFileWriter : public AUD_IWriter
47 * The current position in samples.
52 * The specification of the audio data.
54 AUD_DeviceSpecs m_specs;
61 // hide copy constructor and operator=
62 AUD_SndFileWriter(const AUD_SndFileWriter&);
63 AUD_SndFileWriter& operator=(const AUD_SndFileWriter&);
67 * Creates a new writer.
68 * \param filename The path to the file to be read.
69 * \param specs The file's audio specification.
70 * \param format The file's container format.
71 * \param codec The codec used for encoding the audio data.
72 * \param bitrate The bitrate for encoding.
73 * \exception AUD_Exception Thrown if the file specified cannot be written
76 AUD_SndFileWriter(std::string filename, AUD_DeviceSpecs specs, AUD_Container format, AUD_Codec codec, unsigned int bitrate);
79 * Destroys the writer and closes the file.
81 virtual ~AUD_SndFileWriter();
83 virtual int getPosition() const;
84 virtual AUD_DeviceSpecs getSpecs() const;
85 virtual void write(unsigned int length, sample_t* buffer);
88 #endif //AUD_SNDFILEWRITER