[PD-cvs] SF.net SVN: pure-data:[10445] trunk/externals/iemlib/iemlib1

tmusil at users.sourceforge.net tmusil at users.sourceforge.net
Thu Dec 11 20:38:44 CET 2008


Revision: 10445
          http://pure-data.svn.sourceforge.net/pure-data/?rev=10445&view=rev
Author:   tmusil
Date:     2008-12-11 19:38:44 +0000 (Thu, 11 Dec 2008)

Log Message:
-----------
soundfile_info puts out a 8th float: format code

Modified Paths:
--------------
    trunk/externals/iemlib/iemlib1/soundfile_info-help.pd
    trunk/externals/iemlib/iemlib1/src/iemlib1.c
    trunk/externals/iemlib/iemlib1/src/soundfile_info.c

Modified: trunk/externals/iemlib/iemlib1/soundfile_info-help.pd
===================================================================
--- trunk/externals/iemlib/iemlib1/soundfile_info-help.pd	2008-12-11 19:11:28 UTC (rev 10444)
+++ trunk/externals/iemlib/iemlib1/soundfile_info-help.pd	2008-12-11 19:38:44 UTC (rev 10445)
@@ -1,36 +1,40 @@
-#N canvas 153 56 725 412 10;
-#X obj 31 45 openpanel;
-#X obj 31 26 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
--1;
-#X msg 31 92 read \$1;
-#X obj 31 166 soundfile_info;
-#X obj 31 217 print;
-#X text 40 146 "read"-message needs a symbol (soundfile in wave format)
-;
-#X symbolatom 131 75 66 0 0 0 - - -;
-#X text 50 184 "list"-message output with 7 items;
-#X text 91 224 4.item: <float> header-size in bytes;
-#X text 91 194 1.item: <float> samplerate in Hz;
-#X text 91 204 2.item: <symbol> file-name;
-#X text 91 234 5.item: <float> number of channels;
-#X text 7 2 soundfile_info;
-#X text 130 2 show the header-data of a wav-file;
-#X text 91 254 7.item: <symbol> endianness ("l" for little);
-#X text 260 264 ("b" for big);
-#X text 214 279 (eg. little endian "wav" is natural format on Intel-machines)
-;
-#X text 214 314 (eg. big endian "aiff" is natural format on Macintosh-machines)
-;
-#X text 91 214 3.item: <float> sound-data-length in samples;
-#X text 91 244 6.item: <float> sample-resolution in bytes;
-#X text 95 328 IEM KUG;
-#X text 79 316 musil;
-#X text 109 316 @;
-#X text 115 316 iem.at;
-#X text 30 305 (c) Thomas Musil 2000 - 2005;
-#X text 78 338 Graz \, Austria;
-#X connect 0 0 2 0;
-#X connect 0 0 6 0;
-#X connect 1 0 0 0;
-#X connect 2 0 3 0;
-#X connect 3 0 4 0;
+#N canvas 153 56 730 458 10;
+#X obj 31 45 openpanel;
+#X obj 31 26 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X msg 31 92 read \$1;
+#X obj 31 166 soundfile_info;
+#X obj 31 217 print;
+#X text 40 146 "read"-message needs a symbol (soundfile in wave format)
+;
+#X symbolatom 131 75 66 0 0 0 - - -;
+#X text 50 184 "list"-message output with 7 items;
+#X text 91 224 4.item: <float> header-size in bytes;
+#X text 91 194 1.item: <float> samplerate in Hz;
+#X text 91 204 2.item: <symbol> file-name;
+#X text 91 234 5.item: <float> number of channels;
+#X text 7 2 soundfile_info;
+#X text 130 2 show the header-data of a wav-file;
+#X text 91 254 7.item: <symbol> endianness ("l" for little);
+#X text 260 264 ("b" for big);
+#X text 214 279 (eg. little endian "wav" is natural format on Intel-machines)
+;
+#X text 214 304 (eg. big endian "aiff" is natural format on Macintosh-machines)
+;
+#X text 91 214 3.item: <float> sound-data-length in samples;
+#X text 91 244 6.item: <float> sample-resolution in bytes;
+#X text 75 388 IEM KUG;
+#X text 55 376 musil;
+#X text 89 376 @;
+#X text 97 376 iem.at;
+#X text 58 398 Graz \, Austria;
+#X text 10 365 (c) Thomas Musil 2000 - 2008;
+#X text 90 325 8.item: <float> format code (1 .. linear PCM);
+#X text 286 335 (3 .. IEEE-float);
+#X text 286 345 (6 .. 8 bit ALAW);
+#X text 286 355 (7 .. 8 bit MULAW);
+#X connect 0 0 2 0;
+#X connect 0 0 6 0;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;
+#X connect 3 0 4 0;

Modified: trunk/externals/iemlib/iemlib1/src/iemlib1.c
===================================================================
--- trunk/externals/iemlib/iemlib1/src/iemlib1.c	2008-12-11 19:11:28 UTC (rev 10444)
+++ trunk/externals/iemlib/iemlib1/src/iemlib1.c	2008-12-11 19:38:44 UTC (rev 10445)
@@ -75,6 +75,6 @@
   v2db_setup();
   vcf_filter_tilde_setup();
   
-	post("iemlib1 (R-1.17) library loaded!   (c) Thomas Musil 03.2008");
+	post("iemlib1 (R-1.17) library loaded!   (c) Thomas Musil 11.2008");
 	post("   musil%ciem.at iem KUG Graz Austria", '@');
 }

Modified: trunk/externals/iemlib/iemlib1/src/soundfile_info.c
===================================================================
--- trunk/externals/iemlib/iemlib1/src/soundfile_info.c	2008-12-11 19:11:28 UTC (rev 10444)
+++ trunk/externals/iemlib/iemlib1/src/soundfile_info.c	2008-12-11 19:38:44 UTC (rev 10445)
@@ -1,7 +1,7 @@
 /* For information on usage and redistribution, and for a DISCLAIMER OF ALL
 * WARRANTIES, see the file, "LICENSE.txt," in this distribution.
 
-iemlib1 written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2006 */
+iemlib1 written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2008 */
 
 #include "m_pd.h"
 #include "iemlib.h"
@@ -17,8 +17,9 @@
 #define SFI_HEADER_CHANNELS 4
 #define SFI_HEADER_BYTES_PER_SAMPLE 5
 #define SFI_HEADER_ENDINESS 6
+#define SFI_HEADER_FORMAT_CODE 7
 
-#define SFI_HEADER_SIZE 7
+#define SFI_HEADER_SIZE 8
 
 
 
@@ -143,16 +144,17 @@
       cvec += 4;
       ss = soundfile_info_str2short(cvec);
       /* format */
-      if(ss != 1)            /* PCM = 1 */
+      if((ss != 1) && (ss != 3) && (ss != 6) && (ss != 7))            /* PCM = 1 ; IEEE-FLOAT = 3 ; ALAW = 6 ; MULAW = 7 */
       {
-        post("soundfile_info_read-error:  %s is not PCM-format coded", completefilename);
+        post("soundfile_info_read-error:  %s has unknown format code", completefilename);
         goto soundfile_info_end;
       }
+      SETFLOAT(x->x_atheader+SFI_HEADER_FORMAT_CODE, (t_float)ss);
       header_size += 2;
       cvec += 2;
       ss = soundfile_info_str2short(cvec);
       /* channels */
-      if((ss < 1) || (ss > 100))
+      if((ss < 1) || (ss > 1000))
       {
         post("soundfile_info_read-error:  %s has no common channel-number", completefilename);
         goto soundfile_info_end;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Pd-cvs mailing list