Posted By: esoteric | Sep 8th, 2007 @ 2:08 PM
page 1 of 1
Comments: 9 | Views: 2460
Is it possible to playback in-memory audio with Silverlight (1.0 or 1.1)?

The reason I ask this, is because I think audio has been underprioritized for a while in Flash, but you can now create synthesizers in Flash, and I want to know if that is (going to be) possible in Silverlight as well. Obviously it's a really small feature, but one with huge impact.


Examples

TB-303
Flanger
FL909
Pulse Harmonics
Wavepole Synthesis
EQ Filter
Soundspectrum
8-bit Boy
Scratching
Cell Talk
Reverb
Kalimba

References

http://lab.andre-michelle.com/tag/audio/
http://www.e-phonic.com/misc/
I don't believe that is even possible in the full .NET/WPF without going to pinvoke or call in some additional libraries.

The "preferred" way to do this would be to render the data to a file then open that file on the client.


I'd really like to see some way to do this with high perf and reliability from c# though. It would probably mean adding a new feature to the CLR that allows to spin up a special thread where you can't create garbage (everything pinned etc) and which the garbage collection would not be allowed to touch or something along these line.

Or alternatively wait and see few years if the Garbage Gurus can make the collector do it's thing without risk of so long interruptions that you'd hear it in the audio...

Tom Servo
Tom Servo
W-hat?
Those additional libraries are called Managed DirectSound.
Tom Servo
Tom Servo
W-hat?
Well, not for real-time rendering. Some of these Flash samples sound like it's rendering a loop on the fly and then have it loop via some simple audio playback functionality, with other's I'm not sure, since they react without glitching (could still be done with prerendering, but you have to cut off at the right point and zero crossing).
The first pattern in the 909 sound exactly like something cEvin Key did a while ago. I can't remember exactly what it is because he makes so much music.
"Those additional libraries are called Managed DirectSound."

The application the op refers to requires faster response to user adjustment of on screen parameters than what DS commonly is able to give. I'm not certain if it's due to driver implementation or some extra processing DS does. In Vista and later there are new native Windows APIs that easily give better performance but to use them from .NET you need to pinvoke or use 3rd party lib like NAudio.
Btw here's a new version of what the op was talking about:

http://www.hobnox.com/audiotool.1046.de.html?

If this was done with SL+WASAPI you wouldn't be able to tell the difference from using a native app installed locally, now you can tell it because if you quickly turn the knobs there's a good 100-200 ms delay before the audio is affected.
exoteric
exoteric
I : Next<I>
It would be quite compelling to have Silverlight render directly to WASAPI, when possible, obviously it's not going to be possible on the Mac or on pre-Vista. I wonder if the audio synthesis story for Silverlight is still null, or if there's some progress there. Maybe Silverlight 3.

And by the way, that's a pretty impressive application to have hosted in a browser, Androidi!

I love the endless workspace. This is something we see in the new "Quadrant" tools as well, but not on the Windows desktop.
rhm
rhm
Another Silverlight 2 API fail.

I didn't get as far as looking at the audio APIs because I went right off Silverlight after finding out that on-the-fly bitmap generation wasn't supported and the text layout was crippled. 

I know they had to keep the download small (or at least they felt that was important, I'm not so sure), but they didn't prioritise that well did they? I'd rather had decent core APIs and make more of the built-in controls available in separate DLLs that can be linked by application developers. I mean, a built-in datagrid wasn't really a priority was it?
page 1 of 1
Comments: 9 | Views: 2460
Microsoft Communities