Coffeehouse Thread

10 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Silverlight Audio Synthesis

Back to Forum: Coffeehouse
  • User profile image
    esoteric

    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/

  • User profile image
    androidi

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

  • User profile image
    Tom Servo

    Those additional libraries are called Managed DirectSound.

  • User profile image
    esoteric

    androidi wrote:
    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...



    Expressionless That... sounds... smooth...

    OK, so Managed DirectSound for audio in .Net in general.

    But Silverlight in-memory audio streams - not so much?

    Perhaps it's possible to circumvent with data URI's?

  • User profile image
    Tom Servo

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

  • User profile image
    dentaku

    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.

  • User profile image
    androidi

    Tom Servo said:
    Those additional libraries are called Managed DirectSound.
    "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.

  • User profile image
    androidi

    androidi said:
    Tom Servo said:
    *snip*
    "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.

  • User profile image
    exoteric

    androidi said:
    androidi said:
    *snip*
    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.
    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.

  • User profile image
    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?

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.