clamp
clamp

Reputation: 34046

Looping xWMA sounds with XAudio2

I am using SharpDX to play Sound via XAudio2 and got problems looping an xWMA file on a certain range. the values LoopBegin and LoopLength seem to be completely ignored when using xWMA files; it always loops the entire soundfile.

However on WAV files these values work like expected.

i was already reading http://msdn.microsoft.com/en-us/library/windows...er%28v=vs.85%29.aspx

but i believe i have met all criteria with the values to PlayBegin, PlayLength, LoopBegin, LoopLength etc.

anything specific about xwma data that i am missing here?

i am using this function to set the values in samples since all my files have 44100KhZ

static int MilliSecondsToSamples(double millis)
{
     return (int) (44100.0 * millis / 1000.0);
}

i am on windows 7, .NET4.0

Upvotes: 1

Views: 851

Answers (1)

Ehz
Ehz

Reputation: 2067

According to this page: http://msdn.microsoft.com/en-us/library/windows/desktop/microsoft.directx_sdk.xaudio2.xaudio2_buffer(v=vs.85).aspx

For ADPCM playback loop length must be a multiple of wSamplesPerBlock. Since WMA is compressed too, I think there may be some requirement of keeping the loop length in line with the frame size of the wma file being played back.

Upvotes: 1

Related Questions