POV-Ray : Newsgroups : povray.off-topic : DFT and FFT Server Time
6 Sep 2024 19:21:10 EDT (-0400)
  DFT and FFT (Message 41 to 50 of 55)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 5 Messages >>>
From: Invisible
Subject: Re: DFT and FFT
Date: 20 Jan 2009 10:38:24
Message: <4975eff0@news.povray.org>
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.)


Post a reply to this message

From: Warp
Subject: Re: DFT and FFT
Date: 20 Jan 2009 10:46:24
Message: <4975f1d0@news.povray.org>
Invisible <voi### [at] devnull> wrote:
> It's actually RIFF - a multilation of the Amiga IFF format with all the 
> 4-byte values incorrectly written backwards. (Hence "R" for "reverse".)

  I think the R stands for Resource.

-- 
                                                          - Warp


Post a reply to this message

From: Mike Raiford
Subject: Re: DFT and FFT
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

From: scott
Subject: Re: DFT and FFT
Date: 20 Jan 2009 10:59:27
Message: <4975f4df$1@news.povray.org>
> Have you seen the format spec for the .WAV file format??

You mean this:

http://ccrma.stanford.edu/courses/422/projects/WaveFormat/

Looks very simple to me, about the same level of difficulty as writing a 
windows bmp file, ie very easy.


Post a reply to this message

From: Warp
Subject: Re: DFT and FFT
Date: 20 Jan 2009 11:19:40
Message: <4975f99b@news.povray.org>
Mike Raiford <"m[raiford]!at"@gmail.com> wrote:
> cat mysound.wav | /dev/snd

> "You can't cat a wav file!"

  The amount of things wrong in everything of the above is mind-boggling. ;)

  (For one, you are trying to run /dev/snd as if it was a program. Of course
that's not the only problem.)

-- 
                                                          - Warp


Post a reply to this message

From: Mike Raiford
Subject: Re: DFT and FFT
Date: 20 Jan 2009 11:23:05
Message: <4975fa69$1@news.povray.org>
Warp wrote:
> Mike Raiford <"m[raiford]!at"@gmail.com> wrote:
>> cat mysound.wav | /dev/snd
> 
>> "You can't cat a wav file!"
> 
>   The amount of things wrong in everything of the above is mind-boggling. ;)
> 
>   (For one, you are trying to run /dev/snd as if it was a program. Of course
> that's not the only problem.)
> 

Hmm, does Linux use the same format as DOS for redirection? e.g. it 
should be > /dev/snd (or whatever)

I know what I did was truly ugly, but it worked, that's what was funny.

But, I can't remember the syntax (It's been years since I've really used 
  linux from a command line.)

-- 
~Mike


Post a reply to this message

From: Warp
Subject: Re: DFT and FFT
Date: 20 Jan 2009 12:15:54
Message: <497606ca@news.povray.org>
Mike Raiford <"m[raiford]!at"@gmail.com> wrote:
> Hmm, does Linux use the same format as DOS for redirection? e.g. it 
> should be > /dev/snd (or whatever)

  | is a pipe: The standard output of the program on the left side is
redirected to the standard input of the program on the right side.
However, /dev/snd is not a program and cannot be run.

  If you want to redirect the standard output of a program to a file
(or, in this case, a device), > is the operator for it.

-- 
                                                          - Warp


Post a reply to this message

From: Darren New
Subject: Re: DFT and FFT
Date: 20 Jan 2009 12:39:57
Message: <49760c6d$1@news.povray.org>
Warp wrote:
> Invisible <voi### [at] devnull> wrote:
>> It's actually RIFF - a multilation of the Amiga IFF format with all the 
>> 4-byte values incorrectly written backwards. (Hence "R" for "reverse".)
> 
>   I think the R stands for Resource.

That's what Microsoft wants you to think. Originally it was "reverse", until 
they realized how few people were familiar with the Amiga formats or something.

It's *exactly* IFF, with the endianness reversed. :-)

Altho it does annoy me when I see it mentioned in the press how "RIFF is an 
extensible format created by Microsoft...."

I do like how PNG took it a step farther and encoded into the chunk names 
whether you need to understand the chunk to parse the file, etc.

-- 
   Darren New, San Diego CA, USA (PST)
   "Ouch ouch ouch!"
   "What's wrong? Noodles too hot?"
   "No, I have Chopstick Tunnel Syndrome."


Post a reply to this message

From: Invisible
Subject: Re: DFT and FFT
Date: 21 Jan 2009 04:17:14
Message: <4976e81a$1@news.povray.org>
Mike Raiford wrote:

> 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 ..."

Now try doing that with a sound that's been LZW-compressed. ;-)

Doesn't sound very nice...


Post a reply to this message

From: Mike Raiford
Subject: Re: DFT and FFT
Date: 21 Jan 2009 08:37:24
Message: <49772514$1@news.povray.org>
Invisible wrote:

> 
> Now try doing that with a sound that's been LZW-compressed. ;-)
> 
> Doesn't sound very nice...

I imagine it's about as pleasing as loading an MP3 as a raw PCM audio 
file and playing it. For some reason this one audio app I have 
recognizes every MP3 correctly, except for a handful of files from one 
particular album. Weird.

-- 
~Mike


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 5 Messages >>>

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