1 19 package org.lucane.applications.audioconf; 20 21 import java.io.*; 22 23 import org.lucane.applications.audioconf.audio.*; 24 import org.lucane.common.*; 25 import org.lucane.common.net.ObjectConnection; 26 27 public class Streamer implements AudioRecorderListener 28 { 29 private ObjectConnection connection; 30 private AudioConf plugin; 31 32 public Streamer(AudioConf plugin, ObjectConnection oc) 33 { 34 this.plugin = plugin; 35 this.connection = oc; 36 } 37 38 41 public void audioRecordingStarted(AudioConfig config) 42 { 43 Logging.getLogger().fine("Ready to record"); 44 } 45 46 49 public void audioRecorded(byte[] data, int length) 50 { 51 try { 52 byte[] buffer = new byte[length]; 53 System.arraycopy(data, 0, buffer, 0, length); 54 55 this.connection.write(buffer); 56 } catch (IOException e) { 57 this.plugin.reportRecorderError(e); 58 } 59 } 60 61 64 public void audioRecordingEnded() 65 { 66 this.connection.close(); 67 } 68 } | Popular Tags |