locked
using directsound in javascript project

    Question

  • Hi everyone

    I want use directsound output audio in my application. How i can add it? 

    I create a dynamic library "dsound", add there "audiodefs.h" and "dsound.h", include them in dsound.cpp, but there is end of my knowledge of c++. Can somebody help me?

    Monday, December 09, 2013 4:34 AM

Answers

  • Hello,

    At this time DirectSound is considered deprecated and has been replaced with WASAPI. WASAPI is a very low level interface that can only be called from C++.

    Unfortunately we don't have any audio effects built into the Windows Store app infrastructure.

    If you are writing a Store app that is a music player and you want to use JavaScript you will need to use the "audio" tag. We have added extensibility for the "audio" and "video" tags that allow you to add effects. Audio effects must be implemented as MFTs. MFTs can only be written in C++.

    How to enable effects in a <video> tag (Windows Store apps using JavaScript and HTML)

    http://msdn.microsoft.com/en-us/library/windows/apps/hh452753.aspx

    I hope this helps,

    James


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Monday, December 09, 2013 11:21 PM
    Moderator

All replies

  • Hi Romka,

    What do you want to use DirectSound for?

    DirectSound is not supported in Windows Store apps. Instead they should use the more modern XAudio API (see Replace DirectSound with XAudio2 (and background audio) ). You cannot call XAudio directly from JavaScript. You would need to create a Windows Runtime Component in C++ which you could then call from your JavaScript app.

    How exactly to use this will depend on what you want to do. There are several samples you can look at, but if you aren't familiar with C++ you will likely want to look for a 3rd party component which already implements what you need.

    See Walkthrough: Creating a basic Windows Runtime component in C++ and calling it from JavaScript or C# and http://code.msdn.microsoft.com/windowsapps/site/search?query=XAudio

    --Rob

    Monday, December 09, 2013 4:54 AM
    Owner
  • im trying write my own music player.

    i read about Xaudio2 after your answer. As i understand, it hasnt built in effects like parametrical equalizer and resampler. Dont know about Xadio, but directsound sounds clearer instead of "null output device".

    thanks for guide js+c++, try to build something

    Monday, December 09, 2013 9:57 AM
  • Hello,

    At this time DirectSound is considered deprecated and has been replaced with WASAPI. WASAPI is a very low level interface that can only be called from C++.

    Unfortunately we don't have any audio effects built into the Windows Store app infrastructure.

    If you are writing a Store app that is a music player and you want to use JavaScript you will need to use the "audio" tag. We have added extensibility for the "audio" and "video" tags that allow you to add effects. Audio effects must be implemented as MFTs. MFTs can only be written in C++.

    How to enable effects in a <video> tag (Windows Store apps using JavaScript and HTML)

    http://msdn.microsoft.com/en-us/library/windows/apps/hh452753.aspx

    I hope this helps,

    James


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Monday, December 09, 2013 11:21 PM
    Moderator
  • Its bad. I use in foobar2000 dsound output because its more stable and more comfortable than kernel stream, asio or wasapi.

    So i even cant port dsound to win8 dll by my own?

    What about using ASIO?

    Saturday, December 21, 2013 9:58 AM