RFC: Reworking sound sub-system

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • calris
    Adept
    • Mar 2016
    • 194

    Originally posted by PowerWyrm
    Alright... adding a "data->loaded = false;" after playing a sound did the trick for me. It's very ugly, but it works
    Oh Yuck! - You are essentially reloading the sound into memory from disk every time it is played (although file system caching should help with any delays).

    I worry about what reloading a sound mid-play might do internally - if the SDL sound system is in the middle of playing a sample, you are effectively ripping it out from underneath it.

    I've never really looked at what SDL under Linux does when you play the same sample memory while it is already being played...

    Comment

    • PowerWyrm
      Prophet
      • Apr 2008
      • 2986

      Originally posted by calris
      Hmm - have you had a look at how I've implemented sound for Windows?

      Take a look at:



      It's a much cleaner version (but in the end identical end result) to what Nick pulled. It's much easier to see what is going on
      I bet the Windows sound module will work nicely. Now that the SDL module works fine in PWMAngband, I'll port that too.
      PWMAngband variant maintainer - check https://github.com/draconisPW/PWMAngband (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!

      Comment

      • calris
        Adept
        • Mar 2016
        • 194

        Originally posted by PowerWyrm
        I bet the Windows sound module will work nicely. Now that the SDL module works fine in PWMAngband, I'll port that too.
        Don't bet on it - I never tested it

        Comment

        • PowerWyrm
          Prophet
          • Apr 2008
          • 2986

          Originally posted by calris
          Don't bet on it - I never tested it
          Well I've now ported everything and everything works fine again.

          The only problems I've noticed which were already present in the old system were:
          - Mix_PlayMusic() not playing a sound from the beginning under Windows (fixed by reloading the sound)
          - PlaySound(SND_PURGE) not stopping the current sound (didn't change that, so the Windows module actually plays sounds over the top of each other)
          PWMAngband variant maintainer - check https://github.com/draconisPW/PWMAngband (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!

          Comment

          • PowerWyrm
            Prophet
            • Apr 2008
            • 2986

            By the way, sound.cfg can be removed from \lib\sounds since it's not used anymore...
            PWMAngband variant maintainer - check https://github.com/draconisPW/PWMAngband (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!

            Comment

            • calris
              Adept
              • Mar 2016
              • 194

              Originally posted by PowerWyrm
              By the way, sound.cfg can be removed from \lib\sounds since it's not used anymore...
              It's still used by at least the OS X port. There may be others, not 100% sure

              Comment

              Working...
              😀
              😂
              🥰
              😘
              🤢
              😎
              😞
              😡
              👍
              👎