help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: audio check?


From: Jim Langston
Subject: Re: audio check?
Date: Thu, 06 Sep 2007 14:27:22 -0400
User-agent: Thunderbird 1.5.0.8 (X11/20061204)

John W. Eaton wrote:
On  6-Sep-2007, Jim Langston wrote:

| Isolating down a little the old fashion way
| | In oct-stream.cc | | printf("Getting ready to read\n") ; | is.read (u.buf, sizeof (typename | octave_type_traits<READ_T>::val_type));
|               printf("Done Reading\n") ;
| | This method never returns | | | octave:1> A = [1:10; 1:10]/10;
| octave:2> wavwrite("a.wav", A);
| octave:3> [B, samples_per_sec, bits_per_sample] = wavread("a.wav");
| Getting ready to read
| ^C^CPress Control-C again to abort.
| ^Cpanic: Interrupt -- stopping myself...
| attempting to save variables to `octave-core'...
| save to `octave-core' complete

OK, but which call to fread in wavread is hanging?  That should be
fairly easy to determine as wavread is a .m file.  It would be helpful
to isolate this to a single call to fread rather than a call to
wavread.  Also, since it seems you are the only one who can trigger
this problem, I think you are going to have to narrow it down to
something very specific, like "fread is called and it attempts to read
the following data and it fails to return because it is looping here,
because ...".

Also, perhaps this should be on the bug list?
I'm working with the thought that all problems I encounter are mine since Octave has not been compiled and run under this env. (OpenSolaris, Sun Studio 12 compilers) - any pointers are great as I dig them out. I changed wavread.m to include printf's around the fread's, I get:


octave:1> [B, samples_per_sec, bits_per_sample] = wavread("a.wav");
Getting ready to read
^C^CPress Control-C again to abort.
^Cpanic: Interrupt -- stopping myself...
Opening File
Opened File - OK: 5
First fread RIFF/WAVE signature
attempting to save variables to `octave-core'...
save to `octave-core' complete



I'm not getting past the first fread encountered in the wavread.m file

Debugging output shows the call to iostream, and then calls to c_file_ptr_buf and in particular, the underflow method. I'm not sure what is triggering this, but the bump value is always false and the value of c never varies from 82. My initial thought is
that the stream buffer is not getting read and cleaned out.

wavread.m snippet

......

 printf("Opening File\n");

 # open file for binary reading
 [fid, msg] = fopen (filename, "rb");
 if (fid < 0)
   error ("wavread: %s", msg);
 endif

#
#
   printf("Opened File - OK: %d\n", fid);

 ## check for RIFF/WAVE header
   printf ("First fread RIFF/WAVE signature\n");
 ck_id = char (fread (fid, 4))';
   printf ("First fread - OK - RIFF/WAVE signature\n");
 fseek (fid, 4, SEEK_CUR);
   printf ("Second fread RIFF/WAVE signature\n");
 wave_id = char (fread (fid, 4))';
 if (ck_id != "RIFF" || wave_id != "WAVE")
   fclose (fid);
   error ("wavread: file contains no RIFF/WAVE signature");
 endif


.....

jwe
_______________________________________________
Help-octave mailing list
address@hidden
https://www.cae.wisc.edu/mailman/listinfo/help-octave


--
/////////////////////////////////////////////

Jim Langston
Sun Microsystems, Inc.

(877) 854-5583 (AccessLine)
AIM: jl9594
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]