[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
wavread problems
From: |
Doug Stewart |
Subject: |
wavread problems |
Date: |
Wed, 11 May 2005 11:58:02 -0500 |
User-agent: |
Mozilla Thunderbird 1.0 (Windows/20041206) |
I have been working at fixing wavread, and I have run into a snag.
I am running Andy Adler's port 2.1.42 and
cygwin with 2.1.50
In 2.1.42 this code works
% read riff chunk ChunkID 4 bytes
RIFF_str=char(fread(fid,4,'uchar'));
if (strcmp(RIFF_str,'RIFF')==0)
fclose(fid);
error(sprintf('%s is not a WAV file',wavefile));
end
but in 2.1.50 it doesn't
but this does
% read riff chunk ChunkID 4 bytes
RIFF_str=char(fread(fid,4,'uchar'));
if (strcmp(RIFF_str','RIFF')==0)
fclose(fid);
error(sprintf('%s is not a WAV file',wavefile));
end
I had to transpose the RIFF_str for the strcmp to work.
So my question is
1 - is this a windows problem?
2 - did strcmp change or char change?
3 - more importantly what way does the latest version work?
the code is at
http://dougs.homeip.net/octave/wavread2.m
and a wave file that works with this code on my 2.1.42 is:
http://dougs.homeip.net/octave/ringout.wav
There are still a couple of more changes that I want to make in the file
so consider this as still a work in progress.
thanks in advance
Doug Stewart
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------
- Using C files with OCtave, SITI HAJAR A BAKAR, 2005/05/09
- Re: Using C files with OCtave, Ludovic PĂ©net, 2005/05/09
- Re: Using C files with OCtave, Paul Thomas, 2005/05/09
- Re: wavread problems, Robert A. Macy, 2005/05/11
- Re: wavread problems, Keith Goodman, 2005/05/11
- Re: wavread problems, John W. Eaton, 2005/05/11
- Re: wavread problems, Doug Stewart, 2005/05/11
- Re: wavread problems, Keith Goodman, 2005/05/11
- Error message formatting (was Re: wavread problems), Quentin Spencer, 2005/05/11
- Re: Error message formatting (was Re: wavread problems), Keith Goodman, 2005/05/11