ProffieOS v7.x feature discussions - freeing wavplayer

I can test later tonight for you.
Won’t be for some hours though.
You know the usual…
Work
Pick up kids
Film night

Then play time with sabers.

I will let you know how it goes.

1 Like

I can have a play this evening.

Will this work with both OS 5.9 and 6.5?

1 Like

There’s nothing OS specific about it.

1 Like

Ok cool, had to ask as I’ve not made the jump to 6.5 yet.

just to clarify that this is the code you want to replace?

        if (swing_player_) {
          // avoid overlapping swings, based on value set in ProffieOSSwingOverlap.  Value is
          // between 0 (full overlap) and 1.0 (no overlap)
          if (swing_player_->pos() / swing_player_->length() >= font_config.ProffieOSSwingOverlap) {
            swing_player_->set_fade_time(swing_player_->length() - swing_player_->pos());
            swing_player_->FadeAndStop();
            swing_player_.Free();
          }
        }
        if (!swing_player_) {
          if (!swinging_) {
            if (rss > slashThreshold && SFX_slsh) {
              swing_player_ = PlayPolyphonic(&SFX_slsh);
            } else if (SFX_swng) {
              swing_player_ = PlayPolyphonic(&SFX_swng);
            } else {
              swing_player_ = PlayPolyphonic(&SFX_swing);
            }
            swinging_ = true;
          } else {

this is line 233 - 243 in hybrid font.h in OS5.9

1 Like

No it’s the PlayPolyphonic() function.
Looks like in default OS 5.9 it’s lines 178-188

1 Like

getting a compile error

In file included from D:\proffieboard v2.2\ProffieOS-v5.9 - NoSloppy\ProffieOS\sound\sound.h:77,
                 from D:\proffieboard v2.2\ProffieOS-v5.9 - NoSloppy\ProffieOS\ProffieOS.ino:347:
D:\proffieboard v2.2\ProffieOS-v5.9 - NoSloppy\ProffieOS\sound\hybrid_font.h: In member function 'RefPtr<BufferedWavPlayer> HybridFont::PlayPolyphonic(Effect*)':
D:\proffieboard v2.2\ProffieOS-v5.9 - NoSloppy\ProffieOS\sound\hybrid_font.h:188:28: error: 'class BufferedWavPlayer' has no member named 'current_file_id'
  188 |         if (wav_players[i].current_file_id().GetEffect() == f) {
      |                            ^~~~~~~~~~~~~~~

I’ll take a look at it later tonight.

@Driftrotor I need to dm you what I sent NoSloppy. My excuse sucks because “work” is technically now “play”. Visualize life size HotWheels. :wink:

1 Like

Ok well then I was wrong, sorry. It does require OS6.
Why not upgrade though?

I remoted in just now, clarify because here’s that section in my 5.9, lines 222-242

      if (!guess_monophonic_) {
        if (swing_player_) {
          // avoid overlapping swings, based on value set in ProffieOSSwingOverlap.  Value is
          // between 0 (full overlap) and 1.0 (no overlap)
          if (swing_player_->pos() / swing_player_->length() >= font_config.ProffieOSSwingOverlap) {
            swing_player_->set_fade_time(swing_player_->length() - swing_player_->pos());
            swing_player_->FadeAndStop();
            swing_player_.Free();
          }
        }
        if (!swing_player_) {
          if (!swinging_) {
            if (rss > slashThreshold && SFX_slsh) {
              swing_player_ = PlayPolyphonic(&SFX_slsh);
            } else if (SFX_swng) {
              swing_player_ = PlayPolyphonic(&SFX_swng);
            } else {
              swing_player_ = PlayPolyphonic(&SFX_swing);
            }
            swinging_ = true;
          } else {

Can’t search all of 6.5 remotely so get me the line section for that please so I can try both.

i can confirm it does compile for OS6.

my main reason is i’ve been so busy with testing of other things and wot not i just have not got round to it.
it is on the list to do though.

OS 5.9 lines.

OS 6.5 lines.

1 Like

@Driftrotor Thanks. I’ll report back later.

1 Like
22:38:10.863 -> unit = 5 vol = 0.50, Playing Bandit/blst/blst08.wav
22:38:10.863 -> channels: 1 rate: 44100 bits: 16
22:38:11.753 -> EVENT: Aux-Pressed#1 ON millis=96445
22:38:11.753 -> EVENT: Aux-Pressed ON millis=96445
22:38:11.894 -> EVENT: Aux-Released#1 ON millis=96572
22:38:11.894 -> EVENT: Aux-Released ON millis=96572
22:38:11.894 -> EVENT: Aux-Shortclick#1 ON millis=96572
22:38:11.894 -> EVENT: Aux-Shortclick ON millis=96572
22:38:11.894 -> unit = 6 vol = 0.50, Playing Bandit/blst/blst07.wav
22:38:11.894 -> channels: 1 rate: 44100 bits: 16
22:38:12.128 -> EVENT: Aux-Pressed#2 ON millis=96828
22:38:12.128 -> ************************** Out of WAV players! Getting more...
22:38:12.128 -> *************************** Killing off Bandit/blst/blst03.wav
22:38:12.128 -> unit = 4 vol = 0.50, Playing Bandit/blst/blst03.wav
22:38:12.128 -> channels: 1 rate: 44100 bits: 16
22:38:12.222 -> EVENT: Aux-Released#2 ON millis=96914
22:38:12.222 -> EVENT: Aux-Released ON millis=96914
22:38:12.222 -> EVENT: Aux-Shortclick#2 ON millis=96914
22:38:12.222 -> EVENT: Aux-Shortclick ON millis=96914
22:38:12.222 -> ************************** Out of WAV players! Getting more...
22:38:12.222 -> *************************** Killing off Bandit/blst/blst01.wav
22:38:12.222 -> unit = 0 vol = 0.50, Playing Bandit/blst/blst02.wav
22:38:12.269 -> channels: 1 rate: 44100 bits: 16
22:38:12.410 -> EVENT: Aux-Pressed#3 ON millis=97079
22:38:12.410 -> EVENT: Aux-Pressed ON millis=97079
22:38:12.503 -> EVENT: Aux-Released#3 ON millis=97181
22:38:12.503 -> EVENT: Aux-Released ON millis=97181
22:38:12.503 -> EVENT: Aux-Shortclick#3 ON millis=97182
22:38:12.503 -> EVENT: Aux-Shortclick ON millis=97182
22:38:12.503 -> unit = 5 vol = 0.50, Playing Bandit/blst/blst06.wav
22:38:12.503 -> channels: 1 rate: 44100 bits: 16
22:38:14.238 -> EVENT: Power-Pressed#1 ON millis=98913
22:38:14.238 -> EVENT: Power-Pressed ON millis=98913
22:38:14.332 -> EVENT: Power-Released#1 ON millis=99044
22:38:14.332 -> EVENT: Power-Released ON millis=99044
22:38:14.332 -> EVENT: Power-Shortclick#1 ON millis=99044
22:38:14.332 -> unit = 0 vol = 0.50, Playing Bandit/in/in01.wav

works like a charm and sounds as i’d expect it to.
can’t really tell that sounds are being stopped, but you can here that several are playing in quick succession without loosing the clarity!
Nice Work :+1:

Main goal is to beat it up really good. Apparently there’s a potential for NULL POINTER causing a freeze, so I’d like to figure out why once in a blue moon that might happen.
I’ve only had it happen once, and another tester had a few occurrences.
sort of odd.

1 Like

found it.
had to spam it so hard though and took about 20 secs of spamming to get it to do it.

23:36:39.767 -> channels: 1 rate: 44100 bits: 16
23:36:40.276 -> EVENT: Aux-Pressed#1 ON millis=171476
23:36:40.276 -> EVENT: Aux-Pressed ON millis=171476
23:36:40.414 -> EVENT: Aux-Released#1 ON millis=171619
23:36:40.414 -> EVENT: Aux-Released ON millis=171619
23:36:40.414 -> EVENT: Aux-Shortclick#1 ON millis=171619
23:36:40.414 -> EVENT: Aux-Shortclick ON millis=171619
23:36:40.414 -> ************************** Out of WAV players! Getting more...
23:36:40.414 -> *************************** Killing off Son_Of_Corellia/blst/blst03.wav
23:36:40.414 -> unit = 6 vol = 0.50, Playing Son_Of_Corellia/blst/blst08.wav
23:36:40.414 -> channels: 1 rate: 44100 bits: 16
23:36:41.293 -> EVENT: Aux-Pressed#1 ON millis=172498
23:36:41.293 -> EVENT: Aux-Pressed ON millis=172498
23:36:41.293 -> Playing Son_Of_Corellia/swingl/swingl02.wav
23:36:41.293 -> channels: 1 rate: 44100 bits: 16
23:36:41.386 -> EVENT: Aux-Released#1 ON millis=172607
23:36:41.386 -> EVENT: Aux-Released ON millis=172613
23:36:41.386 -> EVENT: Aux-Shortclick#1 ON millis=172613
23:36:41.386 -> EVENT: Aux-Shortclick ON millis=172613
23:36:41.386 -> ************************** Out of WAV players! Getting more...
23:36:41.386 -> *************************** Killing off Son_Of_Corellia/blst/blst06.wav
23:36:41.431 -> unit = 1 vol = 0.50, Playing Son_Of_Corellia/blst/blst01.wav
23:36:41.431 -> channels: 1 rate: 44100 bits: 16
23:36:41.803 -> EVENT: Aux-Pressed#1 ON millis=173010
23:36:41.803 -> EVENT: Aux-Pressed ON millis=173010
23:36:41.895 -> EVENT: Aux-Released#1 ON millis=173123
23:36:41.895 -> EVENT: Aux-Released ON millis=173123
23:36:41.895 -> EVENT: Aux-Shortclick#1 ON millis=173124
23:36:41.895 -> EVENT: Aux-Shortclick ON millis=173124
23:36:41.895 -> unit = 5 vol = 0.50, Playing Son_Of_Corellia/blst/blst05.wav
23:36:41.943 -> channels: 1 rate: 44100 bits: 16
23:36:42.128 -> EVENT: Aux-Pressed#2 ON millis=173336
23:36:42.128 -> ************************** Out of WAV players! Getting more...
23:36:42.128 -> *************************** Killing off Son_Of_Corellia/blst/blst08.wav
23:36:42.128 -> unit = 6 vol = 0.50, Playing Son_Of_Corellia/blst/blst04.wav
23:36:42.174 -> channels: 1 rate: 44100 bits: 16
23:36:42.219 -> EVENT: Aux-Released#2 ON millis=173440
23:36:42.219 -> EVENT: Aux-Released ON millis=173440
23:36:42.219 -> EVENT: Aux-Shortclick#2 ON millis=173443
23:36:42.219 -> EVENT: Aux-Shortclick ON millis=173443
23:36:42.219 -> ************************** Out of WAV players! Getting more...
23:36:42.219 -> *************************** Killing off Son_Of_Corellia/blst/blst01.wav
23:36:42.266 -> unit = 1 vol = 0.50, Playing Son_Of_Corellia/blst/blst02.wav
23:36:42.266 -> channels: 1 rate: 44100 bits: 16
23:36:42.544 -> EVENT: Aux-Pressed#3 ON millis=173777
23:36:42.544 -> EVENT: Aux-Pressed ON millis=173777
23:36:42.683 -> EVENT: Aux-Released#3 ON millis=173898
23:36:42.683 -> EVENT: Aux-Released ON millis=173898
23:36:42.683 -> EVENT: Aux-Shortclick#3 ON millis=173898
23:36:42.683 -> EVENT: Aux-Shortclick ON millis=173898
23:36:42.683 -> ************************** Out of WAV players! Getting more...
23:36:42.683 -> *************************** Killing off Son_Of_Corellia/blst/blst05.wav
23:36:42.683 -> unit = 5 vol = 0.50, Playing Son_Of_Corellia/blst/blst02.wav
23:36:42.730 -> channels: 1 rate: 44100 bits: 16
23:36:43.056 -> EVENT: Aux-Pressed#4 ON millis=174259
23:36:43.056 -> EVENT: Aux-Pressed ON millis=174259
23:36:43.150 -> EVENT: Aux-Released#4 ON millis=174380
23:36:43.150 -> EVENT: Aux-Released ON millis=174380
23:36:43.150 -> EVENT: Aux-Shortclick#4 ON millis=174380
23:36:43.150 -> EVENT: Aux-Shortclick ON millis=174381
23:36:43.150 -> ************************** Out of WAV players! Getting more...
23:36:43.150 -> *************************** Killing off Son_Of_Corellia/blst/blst04.wav
23:36:43.196 -> unit = 6 vol = 0.50, Playing Son_Of_Corellia/blst/blst02.wav
23:36:43.196 -> channels: 1 rate: 44100 bits: 16
23:36:43.338 -> EVENT: Aux-Pressed#4 ON millis=174568
23:36:43.338 -> EVENT: Aux-Pressed ON millis=174568
23:36:43.431 -> EVENT: Aux-Released#4 ON millis=174636
23:36:43.431 -> EVENT: Aux-Released ON millis=174638
23:36:43.431 -> EVENT: Aux-Shortclick#4 ON millis=174638
23:36:43.431 -> EVENT: Aux-Shortclick ON millis=174638
23:36:43.431 -> ************************** Out of WAV players! Getting more...
23:36:43.431 -> *************************** Killing off Son_Of_Corellia/blst/blst02.wav
23:36:43.431 -> unit = 1 vol = 0.50, Playing Son_Of_Corellia/blst/blst02.wav
23:36:43.431 -> channels: 1 rate: 44100 bits: 16
23:36:43.570 -> EVENT: Aux-Pressed#4 ON millis=174805
23:36:43.617 -> EVENT: Aux-Pressed ON millis=174815
23:36:43.663 -> EVENT: Aux-Released#4 ON millis=174886
23:36:43.663 -> EVENT: Aux-Released ON millis=174887
23:36:43.663 -> EVENT: Aux-Shortclick#4 ON millis=174887
23:36:43.663 -> EVENT: Aux-Shortclick ON millis=174887
23:36:43.663 -> ************************** Out of WAV players! Getting more...
23:36:43.663 -> *************************** Killing off Son_Of_Corellia/blst/blst02.wav
23:36:43.709 -> unit = 5 vol = 0.50, Playing Son_Of_Corellia/blst/blst05.wav
23:36:43.709 -> channels: 1 rate: 44100 bits: 16
23:36:43.801 -> Playing Son_Of_Corellia/swingh/swingh02.wav
23:36:43.801 -> channels: 1 rate: 44100 bits: 16
23:36:44.587 -> EVENT: Clash ON millis=175826
23:36:44.587 -> ************************** Out of WAV players! Getting more...
23:36:44.587 -> *************************** Killing off Son_Of_Corellia/hum/hum01.wav
23:36:44.632 -> NULL POINTER! @8024B09
23:36:44.726 -> NULL POINTER! @8024B35

this is just the last chunk to keep it relatively small / easy to see.

occasionally there is a bit of lag between when i press the aux button and when the sound is played, but that is when i’m spamming for a good few seconds. probably in the region of +10 seconds.
(in all honesty i personally would not spam for this length of time, but i guess you have to test for the Padawan’s.)

In that case since you caught it I’ll hold off for an edit. This way we can just roll through revision(s) and re-testing the same as other stuff.

:wink: Nice font choice.

1 Like

why thank you :grin: it was a recent acquisition

Ok. Progress. Thanks for that report
Killing off Son_Of_Corellia/hum/hum01.wav
That’s no good lol.
Need better filtering that we’re only dealing with effect sounds.
going back in…

1 Like