Skip to content

Commit

Permalink
Rename maxBytes to maxLength
Browse files Browse the repository at this point in the history
  • Loading branch information
mgdigital committed Jun 3, 2019
1 parent de036c0 commit 489fbc1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/core/main/scala/chromaprint/Config.scala
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ final case class Config
interpolate: Boolean
) {

lazy val maxBytes: Int =
lazy val maxLength: Int =
maxDuration * sampleRate

lazy val framerConfig =
Expand Down
8 changes: 4 additions & 4 deletions src/core/main/scala/chromaprint/Fingerprinter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ abstract class Fingerprinter {
}

def pipeRaw(config: Config)(implicit fftImpl: FFT): Pipe[IO,Short,UInt] =
audio => (config.maxBytes match {
case maxBytes if maxBytes > 0 =>
audio.take(maxBytes)
audio => (config.maxLength match {
case length if length > 0 =>
audio take length
case _ =>
audio
}).prefetchN(config.maxBytes max config.sampleRate).
}).prefetchN(config.maxLength max config.sampleRate).
through(SilenceRemover.pipe(config.silenceRemover)).
through(Framer.pipe(config.framerConfig)).
through(HammingWindow.pipe(config.hammingWindow)).
Expand Down

0 comments on commit 489fbc1

Please sign in to comment.