-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Seek for flac #111
Seek for flac #111
Conversation
@@ -23,7 +23,14 @@ func Decode(r io.Reader) (s beep.StreamSeekCloser, format beep.Format, err error | |||
} | |||
} | |||
}() | |||
d.stream, err = flac.New(r) | |||
|
|||
rs, seeker := r.(io.ReadSeeker) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this part needs some thought.
Calling flac.Seek results in the use of a bufio.Buffer and NewSeek does not. According to the kindly mewkiz/flac folks (@mewmew) this could result in performance issues if *os.File is passed in as the io.Reader. It might be better to enable Seek more explicitly but I'm not sure how that might be implemented cleanly. Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's probably fine for now. Calling seek won't work on a bufio.Reader as you mentioned. Lets first see if anyone run into real world performance issues with this, and then we can try to think of a solution.
Great to see seek support added in Beep! Good job @cswank.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds good to me. Thanks @mewmew .
@@ -138,8 +145,11 @@ func (d *decoder) Position() int { | |||
return d.pos | |||
} | |||
|
|||
// p represents flac sample num perhaps? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left this comment because it looked like the API for seek has not really been determined? I'm not sure if sample number is really what you had in mind, but that's how the mewkiz/flac Seek works.
Yes, it’s ready. Yoo-hoo @faiface! |
No description provided.