mirror of
https://gitee.com/openharmony/third_party_libsnd
synced 2024-11-27 03:50:29 +00:00
66 lines
1.7 KiB
C
66 lines
1.7 KiB
C
/*
|
|
** Copyright (C) 2007 Erik de Castro Lopo <erikd@mega-nerd.com>
|
|
**
|
|
** This program is free software; you can redistribute it and/or modify
|
|
** it under the terms of the GNU General Public License as published by
|
|
** the Free Software Foundation; either version 2 of the License, or
|
|
** (at your option) any later version.
|
|
**
|
|
** This program is distributed in the hope that it will be useful,
|
|
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
** GNU General Public License for more details.
|
|
**
|
|
** You should have received a copy of the GNU General Public License
|
|
** along with this program; if not, write to the Free Software
|
|
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
*/
|
|
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <ctype.h>
|
|
|
|
#include <sndfile.h>
|
|
|
|
static void
|
|
usage_exit (const char * progname)
|
|
{
|
|
printf ("\nUsage : %s <infile> <outfile>\n\n", progname) ;
|
|
exit (0) ;
|
|
} /* usage_exit */
|
|
|
|
int
|
|
main (int argc, char * argv [])
|
|
{ char *progname, *infilename, *outfilename ;
|
|
SNDFILE *infile = NULL ;
|
|
SF_INFO sfinfo ;
|
|
|
|
progname = strrchr (argv [0], '/') ;
|
|
progname = progname ? progname + 1 : argv [0] ;
|
|
|
|
if (argc != 3)
|
|
usage_exit (progname) ;
|
|
|
|
infilename = argv [argc-2] ;
|
|
outfilename = argv [argc-1] ;
|
|
|
|
if (strcmp (infilename, outfilename) == 0)
|
|
{ printf ("Error : Input and output filenames are the same.\n\n") ;
|
|
usage_exit (progname) ;
|
|
} ;
|
|
|
|
|
|
if ((infile = sf_open (infilename, SFM_READ, &sfinfo)) == NULL)
|
|
{ printf ("Not able to open input file %s.\n", infilename) ;
|
|
puts (sf_strerror (NULL)) ;
|
|
return 1 ;
|
|
} ;
|
|
|
|
sf_close (infile) ;
|
|
|
|
return 0 ;
|
|
} /* main */
|
|
|