Nsound  0.9.4
ns_readwaveheader.cc
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2 //
3 // $Id: ns_readwaveheader.cc 874 2014-09-08 02:21:29Z weegreenblobbie $
4 //
5 // Copyright (c) 2005-2006 Nick Hilton
6 //
7 // weegreenblobbie_yahoo_com (replace '_' with '@' and '.')
8 //
9 //-----------------------------------------------------------------------------
10 
11 //-----------------------------------------------------------------------------
12 //
13 // This program is free software; you can redistribute it and/or modify
14 // it under the terms of the GNU General Public License as published by
15 // the Free Software Foundation; either version 2 of the License, or
16 // (at your option) any later version.
17 //
18 // This program is distributed in the hope that it will be useful,
19 // but WITHOUT ANY WARRANTY; without even the implied warranty of
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 // GNU Library General Public License for more details.
22 //
23 // You should have received a copy of the GNU General Public License
24 // along with this program; if not, write to the Free Software
25 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 //
27 //-----------------------------------------------------------------------------
28 
29 #include <Nsound/Wavefile.h>
30 
31 #include <iostream>
32 
33 using namespace Nsound;
34 
35 using std::cout;
36 using std::cerr;
37 using std::endl;
38 
39 int main(int argc, char ** argv)
40 {
41 
42  if(argc < 2)
43  {
44  cerr << endl
45  << "usage: readHeader [wave]"
46  << endl
47  << endl;
48  return 1;
49  }
50 
51  std::string filename(argv[1]);
52  std::string info;
53 
54  if( Nsound::Wavefile::readHeader(filename, info) )
55  {
56  cout << info << "SUCCESS" << endl;
57  }
58  else
59  {
60  cout << info << "FAILURE" << endl;
61  }
62 
63  return 0;
64 }
static boolean readHeader(const std::string &filename, std::string &info)
Reads the basic header information and sets the info string.
Definition: Wavefile.cc:934
int main(int argc, char **argv)