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