00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include <it/io.h>
00023 #include <it/mat.h>
00024
00025 int main ()
00026 {
00027 const char *filename_in = "../data/test.wav";
00028 const char *filename_out = "out.wav";
00029 const char *filename_reverse = "reverse.wav";
00030
00031 int depth, srate, channels, length;
00032 imat m;
00033
00034 if (!wav_info (filename_in, &channels, &srate, &depth, &length)) {
00035 fprintf (stderr, "unable to open file %s\n", filename_in);
00036 return (1);
00037 }
00038 printf
00039 ("file name = %s\nchannels = %d\nsampling rate = %d\ndepth = %d\nlength = %d samples/channel\n",
00040 filename_in, channels, srate, depth, length);
00041
00042 m = imat_wav_read (filename_in);
00043
00044 imat_wav_write (filename_out, m, srate, depth);
00045
00046
00047 ivec_reverse (m[0]);
00048
00049 imat_wav_write (filename_reverse, m, srate, depth);
00050
00051 imat_delete (m);
00052 return 0;
00053 }