Plan 9 from Bell Labs’s /usr/web/sources/contrib/de0u/root/sys/src/cmd/squeak/Cross/plugins/Mpeg3Plugin/libmpeg/testaudio.c

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


/* Lex's test program.... */

#include <libmpeg3.h>
#include <stdio.h>


int main() 
{
     mpeg3_t *file;
     int width;
     int height;
     unsigned char buf[100000] = { 0 };
     int i;
     int iter;
     
     
     

     file = mpeg3_open("/home/lex/mp3/bach/lilfug.mp3");
     if(file == NULL) {
	  printf("couldn't open file\n");
	  return 1;
     }



     printf("buf = ");
     for(i=0; i<8; i++)
	  printf(" %d", buf[i]);
     printf("\n");

     for(iter=0; iter<100; iter++) {
	  printf("iter = %d\n", iter);

	  mpeg3_read_audio(file, NULL,
			   (short *) buf,
			   1,
			   1000,
			   0);

	  printf("buf = ");
	  for(i=0; i<8; i++)
	       printf(" %d", buf[i]);
	  printf("\n");
     }
     

     return 0;
     
}


Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.