microsoft / DirectXTK

The DirectX Tool Kit (aka DirectXTK) is a collection of helper classes for writing DirectX 11.x code in C++

Home Page:https://walbourn.github.io/directxtk/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Audio play mp3 Enhancement

cpyburn opened this issue · comments

Would be awesome if you added mp3 support to the audio.

The SoundStreamInstance class is designed to stream content from XACT WaveBanks, so that class will only support what XACT did: PCM, ADPCM, xWMA, and XMA2 (Xbox only).

For MP3 you can use DynamicSoundEffectInstance to integrate into the DirectX Tool Kit for Audio if you have a decompression library for the format. I don't have an explicit tutorial on this, but I should so I'll make this issue a doc request. I do have this implemented using WMA via MediaFoundation in the test suite.

I also have a Xaudio2 sample (i.e. doesn't use DirectX Tool Kit for Audio) for WMA here.

Note that due to patent issues, my tutorial on additional compressed streaming formats would likely not be MP3 but Ogg Vorbis instead, but the basic pattern would apply to any audio decompression library that produces PCM data. For background on the concerns here, see wikipedia.

It looks like there's an Ogg Vorbis library on NuGet I could use for the tutorial here:

https://www.nuget.org/packages/ogg-msvc-x64/

https://www.nuget.org/packages/ogg-msvc-x86/

The SoundStreamInstance class is designed to stream content from XACT WaveBanks, so that class will only support what XACT did: PCM, ADPCM, xWMA, and XMA2 (Xbox only).

For MP3 you can use DynamicSoundEffectInstance to integrate into the DirectX Tool Kit for Audio if you have a decompression library for the format. I don't have an explicit tutorial on this, but I should so I'll make this issue a doc request. I do have this implemented using WMA via MediaFoundation in the test suite.

I also have a Xaudio2 sample (i.e. doesn't use DirectX Tool Kit for Audio) for WMA here.

Note that due to patent issues, my tutorial on additional compressed streaming formats would likely not be MP3 but Ogg Vorbis instead, but the basic pattern would apply to any audio decompression library that produces PCM data. For background on the concerns here, see wikipedia.

Awesome, will you update here once you have the document completed?

Hey Chuck, I was about to give this a shot. I see that you posted some helpful links previously but haven't gotten around to the documentation. Just curious if this is still on your radar or if I should just try to backwards engineer what you have already done?

"I do have this implemented using WMA via MediaFoundation in the test suite."