Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Nov 1999 11:25:12 +0200 (EET)
From:      Sergey Shkonda <serg@bcs.zp.ua>
To:        ports@freebsd.org
Subject:   patch for audio/gogo
Message-ID:  <199911050925.LAA39130@bcs3.bcs.zp.ua>

next in thread | raw e-mail | index | archive | help
  I don't like to use sox before compressing audio from CD's

   The following patch allows gogo to compress raw audio data
.cdr, .cda, .raw files treated as 16 bit stereo 44100 Hz audio
without header.

--
Sergey Shkonda           <serg@bcs.zp.ua>


--- musenc.c.orig	Fri Oct 22 05:15:10 1999
+++ musenc.c	Thu Nov  4 17:20:09 1999
@@ -597,6 +597,9 @@
 MPGE_detectConfigure()
 {
 	int			freq, size, bit, channel;
+#ifdef __unix__
+	int			plaindata = 0;
+#endif
 
 
 	if( musicin != NULL )
@@ -607,6 +610,21 @@
 		musicin = stdin;
 		totalframes = -1;
 	} else {
+		/* check input file extensions */
+#ifdef __unix__
+		int l;
+		l = strlen(szInFile);
+		if (l > 4)
+			if (		!strcasecmp(szInFile+l-4, ".cda") ||
+					!strcasecmp(szInFile+l-4, ".cdr") ||
+					!strcasecmp(szInFile+l-4, ".raw") )
+			{
+				bit = 16;
+				freq = 44100;
+				channel = 2;
+				plaindata = 1;
+			}
+#endif
 		musicin = fopen( szInFile, "rb" );
 		if( !musicin )
 			return	ME_INFILE_NOFOUND;
@@ -625,6 +642,9 @@
 	  }
 	  nEncodeFreq = nInputFreq;
 	}else
+#endif
+#ifdef	__unix__
+	if (!plaindata)
 #endif
 	if( !WAV_checkFMT( musicin, &size, &bit, &freq, &channel) ){
 		fclose( musicin );


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199911050925.LAA39130>