in reply to Re^4: win32 sound problem
in thread win32 sound problem

spencold:

Perhaps it's allocating a buffer internally, and not shrinking it when you load a new sound. Do you get the remains of the first track after the second track plays? (Might be easier to tell if you play a song and then load your track.) If that's the case, it might lead you to a bugfix. Or perhaps load an appropriately long empty file (i.e. silence) before loading your tracks to work around the problem

Finally, the docs show a Play(from, to) method. You might just use that method to play only the track you just loaded/created. It also shows a Reset() method. Perhaps the pointer in the device isn't being reset, so it's loading data into the wrong part of the buffer?

...roboticus

When your only tool is a hammer, all problems look like your thumb.

Replies are listed 'Best First'.
Re^6: win32 sound problem
by spencoid (Acolyte) on Feb 28, 2011 at 03:00 UTC
    i tried everything you suggested and nothing works except for the fakery you suggested of loading an appropriately long bunch of silence. i now have it close to working. it seems that i have to overwrite the buffer with silence as you suggested. now i just need to calculate the amount of silence needed instead of making it a huge amount. too bad that this work around is needed but i am so pleased that you got me looking in a direction i would never have thought of.so it looks like the soundcard buffer is not purged by reset or anything else and has to be completely overwritten with silence. if anyone is listening, i would still like to know how to fix the win32 sound module.

      spencold:

      I'm glad that the workaround is taking care of you. I'm booked solid through this week, but if you remind me on Friday, I'll be happy to look at it over the weekend and see if I can find anything I can fix.

      ...roboticus

      When your only tool is a hammer, all problems look like your thumb.

      if anyone is listening, i would still like to know how to fix the win32 sound module.
      I'll reiterate: you need to submit a bug report to have any chance of this being fixed. You can't assume the module author is listening here at PerlMonks.