POV-Ray : Newsgroups : povray.off-topic : DFT and FFT : Re: DFT and FFT Server Time
6 Sep 2024 21:19:53 EDT (-0400)
  Re: DFT and FFT  
From: Mike Raiford
Date: 20 Jan 2009 10:55:08
Message: <4975f3dc@news.povray.org>
Invisible wrote:
> scott wrote:
>>> Personally I'd love to implement something like that myself - but I 
>>> don't have access to anything that can talk to the sound hardware. :-(
>>
>> You could always just output a raw .wav file and then send it 
>> somewhere to play it (eg mediaplayer or winamp, surely also a smaller 
>> command line player somewhere out there).
> 
> Have you seen the format spec for the .WAV file format??
> 
> It's actually RIFF - a multilation of the Amiga IFF format with all the 
> 4-byte values incorrectly written backwards. (Hence "R" for "reverse".)
> 
> You can't just say "hey, here's some data". You have to include a header 
> that describes - in the most retarded way imaginable - exactly what the 
> layout of the payload is. (E.g., mono or stereo, 8-bit or 16-bit, signed 
> or unsigned, etc.)
> 
> It's no mean feat to set all this up...
> 
> 
> 
> What I guess I *could* do is write a small Java application that accepts 
> raw audio data over TCP and then writes it to the sound hardware. 
> (Although talking to the sound hardware in Java isn't exactly easy 
> either - it's a 12-step process of getting a factory factory factory 
> that possibly yields a factory factory that can then be queried for the 
> kinds of factories it knows how to produce... you get the picture.)

IIRC the data in the wav file isn't too, too bad to format correctly, 
but the header needs to be right.

I remember a conversation with a friend while I was screwing around with 
linux.

I can't remember the exact syntax .. but something like this.

cat mysound.wav | /dev/snd

"You can't cat a wav file!"

"Yeah, I can. Watch"

I hit enter and ... after a short burst of static, it plays the file, 
albeit at the wrong sampling rate.

"Huh, I didn't know you could do that ..."



-- 
~Mike


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.