/** * Chainable constructor * @param as The audio stream to process */ public BeatDetector( final AudioStream as ) { this( as, as.getFormat() ); }
/** * {@inheritDoc} */ @Override public String toString() { return "[Audio: "+getSampleRateKHz()+"KHz, "+getNBits()+"bit, "+ getNumChannels()+" channel"+(getNumChannels()>1?"s":"")+ ", "+(isSigned?"signed":"unsigned")+", "+ (isBigEndian?"big-endian":"little-endian")+"]"; }
/** * Plays a sound through the audio API. */ protected void playNormalSound( AudioStream s ) { AudioPlayer ap = new AudioPlayer( s ); ap.run(); }
/** * {@inheritDoc} * * @see org.openimaj.audio.samples.SampleBuffer#getSampleChunk() */ @Override public SampleChunk getSampleChunk() { final SampleChunk sc = new SampleChunk(this.byteBuffer, this.format); sc.setStartTimecode(this.timecode); return sc; }
@Override public boolean hasNext() { if (next != null) return true; next = nextSampleChunk(); return next != null; }
/** * {@inheritDoc} * * @see org.openimaj.ml.annotation.Annotator#annotate(java.lang.Object) */ @Override public List<ScoredAnnotation<String>> annotate(final DoubleFV object) { return this.getAnnotator().getAnnotator().annotate(object); }
/** * {@inheritDoc} * @see org.openimaj.audio.AudioStream#getLength() */ @Override public long getLength() { return this.stream.getLength() * nLoops; } }
/** * {@inheritDoc} * * @see org.openimaj.time.TimeKeeper#stop() */ @Override public void stop() { this.setMode(Mode.STOP); }
/** * Default constructor * @param format The format to attempt to open the sound line */ public JavaSoundAudioGrabber( final AudioFormat format ) { this.setFormat( format ); }
/** * Fire the event and audio is now available */ @Override protected void fireAudioAvailable() { for (final AudioGrabberListener l : this.listeners) l.samplesAvailable(this.currentSample); }
/** * Chainable constructor * @param as The audio stream to process */ public BeatDetector( final AudioStream as ) { this( as, as.getFormat() ); }
/** * {@inheritDoc} * * @see org.openimaj.audio.AudioStream#getLength() */ @Override public long getLength() { return this.stream.getLength(); } }