Problem with SetSartPoint in DirectMusic

I am trying to implement a “pause” in my audio system. First I stop the segment state and recover its seek pointer, then when the pause is over, I call IDirectMusicSegment8::SetStartPoint and IDirectMusicPerformance8::PlaySegmentEx.< xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

 

This technique works well for the MIDI files but WAV files seem to ignore the new start point and they start playing form the beginning again. 

 

According to the documentation its possible to set a music-time length grater than the seek pointer and then call  SetStartPoint, or use DirectMusic Producer to create a segment file that has wave and tempo tracks and the loader would set the correct music-time length based on the tempo of the segment.

 

I have tried these two options using static and streaming waves without success. The wave continues playing from the beginning. I have also tried:

 

* cloning a portion of the segment

* recovering the DirectSound buffer and stop it

* adding my wave sounds into a DLS collection and playing them as if they were instruments of a segment created with DirectMusic Producer.

 

All these options have also failed. Sad

 

Any suggestions to solve this problem are much appreciated!

 

Thanks Smile




Answer this question

Problem with SetSartPoint in DirectMusic

  • Jeremy_B

    Thank you very much for your answer.Smile

    < xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /> 

    I will try another way



  • MHoess

    This is by design when playing waves as segments. It's very unfortunate, but the way DirectMusic works makes this a bit difficult.

    Waves opened as segments cause segments to be created that have juts one event in them. That would be a play wave trigger event. The segment length will be 1 also by design.

    SetStartPoint causes DirectMusic to scan forward in the segment's event list and to cause playback of only the events past that point. Since a wave segment has only one event and the segment is only 1 tick long this just doesn't work.

    Sorry.

    There may be other tricks to do what you want, but unfortunately I don't know what they are.

    kelly craven
    Software Development Engineer
    WGGT Audio Test Microsoft

    This posting is provided “AS IS” with no warranties,
    and confers no rights. You assume all risk for your use.
    c  Microsoft Corporation. All rights reserved. < xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />


  • Problem with SetSartPoint in DirectMusic