Some housekeeping fixes and fix a bug with "FR" that prevented it's functioning.

This commit is contained in:
Charles Lohr 2016-08-13 14:09:16 -04:00
parent c6d1e93f5d
commit aad48e3799
4 changed files with 20 additions and 4 deletions

View file

@ -170,7 +170,7 @@ void LoadRaw()
FILE * f = fopen( rawfilename, "rb" );
if( !f )
{
fprintf( stderr, "Error: Can't open the specified rawfile.\n" );
fprintf( stderr, "Error: Can't open the specified rawfile. %s\n", rawfilename );
exit( -20 );
}
@ -200,6 +200,9 @@ void LoadRaw()
int sbp = 0;
float IntSoundBuffer[sbs];
FILE * fr = fopen( "folded_data.txt", "w" );
for( i = 0; i < SoundPictureStacks; i++ )
{
int nplace = ((int)(SoundPictureTime * (i+1)))&0xffffffe;
@ -233,8 +236,16 @@ void LoadRaw()
{
SoundPicture[i*SoundPictureBins+j] = nf->outbins[j];
}
for( j = 0; j < nf->freqbins; j++ )
{
fprintf( fr, "%f ", nf->folded_bins[j] );
}
fprintf( fr, "\n" );
}
fclose( fr );
FILE * pic = fopen( "pic.pgm", "wb" );
fprintf( pic, "P6\n%d %d\n255\n", SoundPictureStacks, SoundPictureBins );
int x, y;
@ -258,6 +269,8 @@ void LoadRaw()
}
fclose( pic );
}
int main(int argc, char ** argv)