• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Sound Issues with Different Platforms

 
Ranch Hand
Posts: 176
Mac Chrome Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everyone.

I'm developing a game and want to add some nice little music to it. I'm using the javax.sound.sampled package to do this. I have simple WAV player class like so:

Which I can use in a simple thread such as this one:


When using the MenuSong class on a Windows platform it works fine, run() starts the music and cancel() stops it. However, on Unix platforms such as CentOS or Mac OS the program "blocks" on s.stop(); - by "block" I mean the execution of the code seems paused at that point and everything there after simply isn't executed.

The API for the method stop() mentions that:

This doesn't guarantee that there will never be discontinuities beyond the current buffer, of course; if the stopped condition continues for too long, input or output samples might be dropped


But I don't understand what that means.

Help on this issue would be greatly appreciated as it appears that WavPlayer might totally have to be redesigned.

Thank-you.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic