Ejemplo n.º 1
0
            public override void run()
            {
                this.totalSamplesRead = 0L;
                Microphone.access_200(this.this_0).info("started recording");
                if (Microphone.access_300(this.this_0))
                {
                    Microphone.access_402(this.this_0, new Utterance("Microphone", Microphone.access_500(this.this_0).getFormat()));
                }
                Microphone.access_700(this.this_0).add(new DataStartSignal(Microphone.access_600(this.this_0)));
                Microphone.access_800(this.this_0).info("DataStartSignal added");
                IOException ex2;

                try
                {
                    Microphone.access_100(this.this_0).start();
                    while (!this.done)
                    {
                        Data data = this.readData(Microphone.access_400(this.this_0));
                        if (data == null)
                        {
                            this.done = true;
                            break;
                        }
                        Microphone.access_700(this.this_0).add(data);
                    }
                    Microphone.access_100(this.this_0).flush();
                    if (Microphone.access_900(this.this_0))
                    {
                        Microphone.access_500(this.this_0).close();
                        Microphone.access_100(this.this_0).close();
                        java.lang.System.err.println("set to null");
                        Microphone.access_102(this.this_0, null);
                    }
                }
                catch (IOException ex)
                {
                    ex2 = ex;
                    goto IL_138;
                }
                goto IL_173;
IL_138:
                IOException ex3 = ex2;

                Microphone.access_1000(this.this_0).warning(new StringBuilder().append("IO Exception ").append(Throwable.instancehelper_getMessage(ex3)).toString());
                Throwable.instancehelper_printStackTrace(ex3);
IL_173:
                long duration = ByteCodeHelper.d2l((double)this.totalSamplesRead / (double)Microphone.access_500(this.this_0).getFormat().getSampleRate() * 1000.0);

                Microphone.access_700(this.this_0).add(new DataEndSignal(duration));
                Microphone.access_1100(this.this_0).info("DataEndSignal ended");
                Microphone.access_1200(this.this_0).info("stopped recording");
                lock (this.@lock)
                {
                    Object.instancehelper_notify(this.@lock);
                }
            }
Ejemplo n.º 2
0
            public void stopRecording()
            {
                Microphone.access_100(this.this_0).stop();
                object obj;

                System.Exception     ex2;
                InterruptedException ex4;

                try
                {
                    System.Threading.Monitor.Enter(obj = this.@lock);
                    try
                    {
                        while (!this.done)
                        {
                            Object.instancehelper_wait(this.@lock);
                        }
                        System.Threading.Monitor.Exit(obj);
                    }
                    catch (System.Exception ex)
                    {
                        ex2 = ex;
                        goto IL_54;
                    }
                    goto IL_57;
                }
                catch (InterruptedException ex3)
                {
                    ex4 = ex3;
                    goto IL_59;
                }
IL_54:
                InterruptedException ex8;

                try
                {
                    System.Threading.Monitor.Exit(obj);
                    throw ex2;
                }
                catch (InterruptedException ex7)
                {
                    ex8 = ex7;
                }
                InterruptedException ex9 = ex8;

                goto IL_7E;
IL_57:
                return;

IL_59:
                ex9 = ex4;
IL_7E:
                InterruptedException ex10 = ex9;

                Throwable.instancehelper_printStackTrace(ex10);
            }