Win a copy of Rust Web Development this week in the Other Languages forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Problem playing sound from application

 
Ranch Hand
Posts: 750
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Playing sounds is usually done in applets, but using

import sun.audio.*;

We can play sounds..


When I start program, and call sound it works fine, but second time I call it nothing happens, my code is too large and complex to post, but I wondered if there was an obvious reason for this.

Thanks
 
colin shuker
Ranch Hand
Posts: 750
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well it kinda seems like a sound is like a tape cassete.
Once you've played it, you have to rewind it before you can play it again,
so when I refresh the value it plays again, don't think this is the proper way to do it.

Any thoughts?
 
Ranch Hand
Posts: 621
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
well!!!
i think the reason explained by you is right but instead of refreshing
each time why dont you try the concept of EOF(End of File)......since you are using the AudoiPlayer but i am not familiar with it i have never triedi am not sure if this will be applicable to it or not..........what i can suggest is you start to play the file and it should play till the end of file....then later if you want it to play again just put it into loop...so that it is replayed.............i hope it will help you atlest to some extent....
 
reply
    Bookmark Topic Watch Topic
  • New Topic