[PD] Wav file corruption with writesf~

Lex Ein lex_ein at f-m.fm
Mon Apr 19 15:17:07 CEST 2004


You don't actually describe the failure: noise?  silence? error generation?

Debugging steps:
  Do aplay and lame play:
    Audacity-generated Tone wav files?
    Windows Sound Recorder-generated wav files?
If they do, then there may be a .wav format problem with Pd.
If they don't then the problem likely lies with aplay and lame, or some
configuration option, like -x (byte order).

On my windows box, the writesf~ help patch generates a file with the
following headers, which plays correctly in the Sound Recorder tool
(something of a rough-and-ready benchmark), Audacity, and WinAMP:
Hopefully, yours is the same.

000000  52 49 46 46 24 B1 02 00 57 41 56 45 66 6D 74 20  RIFF$?? WAVEfmt
000010  10 00 00 00 01 00 02 00 44 AC 00 00 10 B1 02 00  ?   ? ? D¼  ???
000020  04 00 10 00 64 61 74 61 00 B1 02 00 2C 13 00 00  ? ? data ?? ,!!
000030  34 0B 00 00 32 03 00 00 2C FB 00 00 2B F3 00 00  4?  2?  ,?  +?

Note that there's no 'fact' chunk before the 'data' chunk.  It's "not
required for PCM data", but might be erroneously expected by aplay and lame.

Windows Sound Recorder always adds the 'fact' chunk.
Audacity seems not to add the 'fact' chunk for PCM files.

The WAV file format is rather extensively defined.
  http://www.sonicspot.com/guide/wavefiles.html

thewade wrote:
>>> Can anyone tell me why my wav files are written corrupted on both
>>> my windows and linux machines using [writesf~]?
>> 
>> Sending the message \"open -wave -bytes 4 -rate 44100
>> /tmp/foo.wav\" works for me when I want 32-bit floating point.
>> \"-bytes 2\" should write a normal 16 bit wav file. Try using all
>> the flags to write an explicit header for your wav file instead of
>> no flags and trusting that the header will come out right.
> 
> 
> Ive tried the above, but still cant get aplay or lame to recognize
> files. audacity opens them fine, and can save them, but even then
> lame and aplay cant read them! I dont know what to do. THe only thing
> I can do is move them to my windows machine and open->save as the
> soundfiles in soundforge. That seems to repair them.
> 
> Is there something I can do to see where exactly in the sound file
> the problem is happening? Some sort of wave file analysis tool? Are
> aif files loseless, just like wav files? What are my alternatives?
> 
> Thanks for the help! -thewade
> 
> _______________________________________________ PD-list mailing list 
> PD-list at iem.at http://iem.at/cgi-bin/mailman/listinfo/pd-list









More information about the Pd-list mailing list