--- sox.20050917/src/wav.c	2005-09-17 18:13:04.000000000 +0200
+++ sox.20050917-inst5/src/wav.c	2007-01-03 07:13:00.000000000 +0100
@@ -1745,10 +1745,25 @@
     {
         case WAVE_FORMAT_IMA_ADPCM:
         case WAVE_FORMAT_ADPCM:
+            st_fail_errno(ft,ST_ENOTSUP,"PCM not supported");
+            break;
 #ifdef ENABLE_GSM
         case WAVE_FORMAT_GSM610:
+	    {	st_size_t	gsmoff;
+		/* rounding bytes to blockAlign */
+		gsmoff = offset * wav->blockAlign / wav->samplesPerBlock + wav->blockAlign * ft->info.channels / 2;
+		gsmoff -= gsmoff % (wav->blockAlign * ft->info.channels);
+		ft->st_errno = st_seek(ft, gsmoff + wav->dataStart, SEEK_SET);
+		if( ft->st_errno == ST_SUCCESS )
+		    new_offset = offset;
+		    alignment = offset % wav->samplesPerBlock;	/* offset is in samples */
+		    if (alignment != 0)
+			new_offset += (wav->samplesPerBlock - alignment);
+		    wav->numSamples = ft->length - (new_offset / ft->info.channels);
+		}
+#else
+            st_fail_errno(ft,ST_ENOTSUP,"GSM support not compiled in");
 #endif
-            st_fail_errno(ft,ST_ENOTSUP,"Only PCM Supported");
             break;
         default:
             new_offset = offset * ft->info.size;
@@ -1756,7 +1771,7 @@
             channel_block = ft->info.channels * ft->info.size;
             alignment = new_offset % channel_block;
             /* Most common mistaken is to compute something like
-             * "skip everthing upto and including this sample" so
+             * "skip everything upto and including this sample" so
              * advance to next sample block in this case.
              */
             if (alignment != 0)
