Jump to content



Photo
- - - - -

PinballY - Startup Audio (for Background Music)

pinbally startup adio music

  • Please log in to reply
1 reply to this topic

#1 Tesla

Tesla

    Pinball Fan

  • Silver Supporter
  • 1,192 posts
  • Location:Texas, USA

  • Flag: United States of America

  • Favorite Pinball: Star Trek - TNG

Posted 24 November 2025 - 12:29 AM

This actually works pretty good (as is) for a little background music while browsing in the Selector-Wheel (looking for a nice table to play).

http://mjrnet.org/pi...AudioVideo.html

 

Up till now, my cabinet has been (purposely) fairly quiet when in PinballY, and Attract-Mode is just random still-images of my tables (as desired).

 

I just dropped-in a renamed copy of the file "Art of Noise - Paranoimia.mp3" and it started playing when PinballY starts-up. Nice!

It stops when you find a table and start-it. (perfect)

 

But too bad it doesn't start playing-again when you come back to the wheel (this audio-file or the next one in the folder).

 

I had envisioned background music while in Attract-Mode (invoked after a short-ish delay), but this works also.

 

So, is this feature also accessible with PinballY's JavaScript implementation?

If so ... if wonder if you try to change it's behavior (as described above) or do it more from scratch (using the function-calls at hand)? 

 

As far as "when" the music starts playing, I bet if you can do one (at PinballY start), you can easily do the other (at Attract-Mode start) or even both. <smile>


Edited by Tesla, 25 November 2025 - 09:10 PM.


#2 mjr

mjr

    Pinball Wizard

  • Members
  • PipPipPipPipPip
  • 3,318 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness

Posted 25 November 2025 - 04:00 AM

That's an interesting idea to have a continuous background soundtrack.  You're right that it's not a native feature currently - I was envisioning the startup track as just a self-contained clip that would play when the program is first launched, and then end.

 

You probably could accomplish something like that with Javascript, although it would take a little experimenting to get all the details together.  I think the basic idea would be to create a drawing layer in the main window to contain the audio.  You wouldn't actually draw anything there - it would just be a transparent layer, effectively making it invisible.  But you'd use drawingLayer.loadVideo() to load your audio track.  (I **think** loadVideo will work fine with plain audio files, but I'd have to check.  If not, you could work around it by ffmpeg'ing the audio tracks into video container files, like .mp4.  It would be inelegant but I think workable.)

 

Then you'd use the "gamestarted" and "gameover" events to stop and start the audio tracks (stop background audio track on game started, start a new background audio track on game ended).


While you're at it, you could also respond to the "attractmodestart" and "attractmodeend" events in the same way, to play other audio tracks while in attract mode.







Also tagged with one or more of these keywords: pinbally, startup adio, music