Skip to content
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

Issue with seek when running in Node #125

Closed
richardlevy opened this issue Apr 22, 2015 · 3 comments
Closed

Issue with seek when running in Node #125

richardlevy opened this issue Apr 22, 2015 · 3 comments

Comments

@richardlevy
Copy link

Hi,

I've implemented a Node based Aurora player, which plays FLAC and (some!)MP3. I added seek functionality last night by simply using player.seek() but I get this error:

TypeError: Cannot call method 'once' of undefined at Player.seek (/Users/rich/Development/AV/player.js:132:18)

The undefined object is a queue object :

132 : this.queue.once('ready', (function(_this) {

Which I assume is internal to the player as I haven't created or initialized any form of queue.

Have I missed something in the node environment?

Thanks
Rich

@crackofdusk
Copy link
Member

What kind of file are you trying to play? There is currently no seeking support in flac.js (see audiocogs/flac.js#8)

@richardlevy
Copy link
Author

I tried with MP3 and FLAC.

@vvision
Copy link

vvision commented Apr 24, 2015

Maybe this comment can help.
The point is flac.js uses seektables to perform a seek. As it's not an accurate way of seeking, it will jump to the closer seek point rather than calculating the right point to continue playing the song.

Indeed, if the file has a seektable with seek points every seconds, seeking should work well.
So if seeking fail, adding a proper seektable to a flac file with metaflac might help:
metaflac --add-seekpoint=1s *.flac

I manage to get seeking work with the above command. Once a song has a seektable, I can use seek while it plays.

I don't know if this could be of any help as you're working "in the node environment" (I've done it in the browser), but I think it's worth mentioning it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants