Search:

Type: Posts; User: edwardone123

Search: Search took 0.07 seconds.

  1. Replies
    31
    Views
    4,142

    Re: thread/timer/sound interaction

    thats what i want : use different frequency every n seconds , at least every 5 seconds (ideally every second )
  2. Replies
    31
    Views
    4,142

    Re: thread/timer/sound interaction

    I did like this and it removes problem this.sound60(freq[44],100,0.5);
    but i need to place into sound60 value of each element of array
    how can i do it ?
  3. Replies
    31
    Views
    4,142

    Re: thread/timer/sound interaction

    How can do single call ?
  4. Replies
    31
    Views
    4,142

    Re: thread/timer/sound interaction

    when i m trying to call this piece from run() i m getting same problem timer increment on 13 seconds
    Where exactly i have to place it ?

    try {

    for(int i=1;...
  5. Replies
    31
    Views
    4,142

    Re: thread/timer/sound interaction

    Yes run() can call sound .How can i do it ?
  6. Replies
    31
    Views
    4,142

    Re: thread/timer/sound interaction

    Yes that was initial intention : run 2 independent threads
    One for paint ( exec every 1 second )
    Another thread for loop .
    Can I please ask you to add to this program ...
  7. Replies
    31
    Views
    4,142

    Re: thread/timer/sound interaction

    Difference between time before loop and time after loop is 13301 (obtained using system.currenttimemillis() )
    Thank you very much
    Edward
  8. Replies
    31
    Views
    4,142

    Re: thread/timer/sound interaction

    System.out.println("time 1 "+System.currentTimeMillis());

    for(int i=1; i<55; i++){
    System.out.println("time 2 "+System.currentTimeMillis());...
  9. Replies
    31
    Views
    4,142

    Re: thread/timer/sound interaction

    System.out.println("time 3 "+System.currentTimeMillis());

    for(int i=1; i<55; i++){
    this.sound60(freq[i],100,0.5);//day

    System.out.println("time 4 ...
  10. Replies
    31
    Views
    4,142

    Re: thread/timer/sound interaction

    then its
    time 3 1367607840687
    time 4 1367607840893
  11. Replies
    31
    Views
    4,142

    Re: thread/timer/sound interaction

    I have placed 4 currenttimein milliseconds
    System.out.println("time 1 "+System.currentTimeMillis());
    g.drawString("hour "+ hour + "minute :" + minute + "second :" + second, 14, 30);
    ...
  12. Replies
    31
    Views
    4,142

    Re: thread/timer/sound interaction

    How can i measure this time ?
  13. Replies
    31
    Views
    4,142

    Re: thread/timer/sound interaction

    I want code to show time on display without delay and at the same time play sound using this.sound60(freq[i],100,0.5) without any delay and interference with showing time .Thank you ...
  14. Replies
    31
    Views
    4,142

    Re: thread/timer/sound interaction

    Thank you very much
    Can you please tell me how do i change code?
  15. Replies
    31
    Views
    4,142

    Re: thread/timer/sound interaction

    I do not use timer class .By timer i mean displaying current time on the screen ,which is slow down .To get time i m using calendar
  16. Replies
    31
    Views
    4,142

    thread/timer/sound interaction

    Good morning !
    I m new to Java ,but I believe this question about thread organisation in my program ..Can you please help me to optimize it ?
    Program has to do count time and show it...
Results 1 to 16 of 16