|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Invisible wrote:
>
> Sounds pretty interesting.
>
> 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. :-(
>
> (Haskell has a binding for libSDL - but it doesn't work on Windoze.)
I know this is probably painful, but ... under the windows platform does
Haskell have access to COM libraries? DirectX uses COM, you may be able
to use DirectSound (or is it DirectShow, now?) via its COM interfaces..
Either than or write a simple C Dll, and import the functions from that
DLL into the Haskell application.
You'll of course need to download the DirectX SDK for that to work.
--
~Mike
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Mike Raiford wrote:
>> (Haskell has a binding for libSDL - but it doesn't work on Windoze.)
>
> I know this is probably painful, but ... under the windows platform does
> Haskell have access to COM libraries?
It has access to most of the Win32 API. If I can figure out what calls
to execute, it should be doable.
> DirectX uses COM, you may be able
> to use DirectSound (or is it DirectShow, now?) via its COM interfaces..
Seems plausible.
> Either than or write a simple C Dll, and import the functions from that
> DLL into the Haskell application.
Heh. As if I could *ever* do that... I don't even know how DLLs work!
> You'll of course need to download the DirectX SDK for that to work.
That's the easy part. ;-)
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> 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).
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Invisible wrote:
>
> Heh. As if I could *ever* do that... I don't even know how DLLs work!
>
Oh, now. DLLs aren't big scary things. They're just libraries. Creating
a DLL project in Visual C is a snap. Then you just create the functions
you want to export using the extern "C" __declspec( dllexport )
decoration on the function.
>> You'll of course need to download the DirectX SDK for that to work.
>
> That's the easy part. ;-)
Depends ... ;) if you're impatient like me it's excruciating.
--
~Mike
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
>> I know this is probably painful, but ... under the windows platform does
>> Haskell have access to COM libraries?
>
> It has access to most of the Win32 API. If I can figure out what calls to
> execute, it should be doable.
http://msdn.microsoft.com/en-us/library/ms712879.aspx
You could first start off by checking that it plays a pre-existing WAV file,
then write the WAV file and play it immediately afterwards, then try out the
SND_MEMORY flag to play it directly from memory...
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |