-
Notifications
You must be signed in to change notification settings - Fork 46
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
"undefined" error when attempting to seek #8
Comments
Yup, pretty sure seeking was never implemented for the FLAC demuxer. |
Ok, thanks. |
Hey @kjantzer, I added some limited SEEKTABLE support which might help you out a bit. You can find it in the SEEKTABLE branch of my fork (https://github.com/mattberkowitz/flac.js/tree/SEEKTABLE) |
Hi, I tried the fork from @mattberkowitz, but when I seek, playback starts about 10 seconds after the specified seek point. Has anyone had this problem? Example:
Or
|
Hey @osmestad I just did a quick test on a file of mine where I tried to seek to the 2:00 mark of a track in both aurora and vlc and it matched up pretty well. The seeking is based on the SEEKTABLE stored in the flac file, which is basically a collection of times and associated frames, rather than real time calculation of the frame to seek to. When you execute a seek it will go to the nearest seekpoint, which depending on the frequency of points could be several seconds off. Does this sound like what might be causing your problem? You can both view the seekpoints stored in a given file, as well generate new ones using metaflac. Try generating one every 1s and see if that makes things better |
Thanks @mattberkowitz, if I add a seekpoint each second that seems to make it work properly. I guess I was unlucky with the sample Flac files I tested, I used the 16-bit ones from the bottom of this page: http://www.eclassical.com/pages/24-bit-faq.html , and some from http://www.bowers-wilkins.com/Downloads/downloads.html (requires registration). |
@mattberkowitz can you send a pull request for your seek table support? I'd like to merge it in. Also, I'd like to add sample accurate seeking to aurora.js at some point to avoid bad seek table issues. There should be a way to specify a range of accuracy within which to seek. |
Seeking work perfect, but if seek to near end of track (in this track and other) "player.player.seek (180352)" return TypeError: Cannot read property 'offset' of undefined http://master255.no-ip.org/?file=/res/Музыка/B/Benny Benassi/Benny Benassi - Cinema (featuring Gary Go).flac where get max seek time? And how to fix this problem??? |
I try to correct aurora.js because it return wrong big index = 19: |
last seek point dont want play and player stoping at this moment. |
I win the problem, but my code not pretty very well. I add duration and buffered in asset.demuxer and add |
Final dirty code )) |
Is it possible to add seekpoints at every second with the AV.Demuxer? I've been trying to modify the SEEKTABLE-case but after each change the whole thing breaks... |
@enjikaka The seektable is processed after the header is available, generally at that point the entire file hasn't been loaded. In normal flac frame length can't be determined without decoding (see https://xiph.org/flac/faq.html#api__frame_length). It may be possible that you could decode each packet as it is retrieved and create seekpoints at that point, but I assume it would be pretty intensive. Also, it's been awhile since I've looked at the code and can't give much more direction without digging in. You can take a look at the metaflac (https://www.xiph.org/flac/documentation_tools_metaflac.html) source for the --add-seekpoint=#s option to see how they generate them |
The new music service Tidal uses Aurora and Flac.js to play lossless audio. I wonder how they solved the seeking... :/ Seeking takes about 10 seconds so... maybe it's doing something serverside? Tidal: http://listen.tidalhifi.com |
Actually we ended up using PNaCl and C code for our Flac decoding on Tidal :) |
@osmestad Oh, so you are not using Aurora and FLAC.js at all then? (It's still in the source-code on the client anyway). Also, off topic now, any chance you guys could remove the "window.chrome"-detection for lossless streaming? It'd be nice if I could put Tidal in a |
No we are not using Aurora any more, but there is still a reference to the files yes. For desktop usage it would require more than removing the window.chrome detection, but we are working on it :) The screenshot shows integration with another product that we offer for professional users: http://pro.wimpmusic.com/ |
@osmestad Okay! Cool. Why did you choose not to use FLAC.js in the end? Was it because of the lack of support for seeking? ChromeOS have native support for FLAC, just so you know. It can play FLACs in the |
We ended up with PNaCl to get the audio decoding in a separate process, that helped avoid audio glitches when a lot happens in the browser :) |
Interesting feedback. We should revisit worker decoding in Aurora.js. See audiocogs/aurora.js#105. |
I see that @mattberkowitz's seektable was merged, but I am still getting the same |
All major browsers support FLAC now so there is no need to use FLAC.js. :)
|
not. The built-in html5 player in browsers cannot play some tracks. Aurora can. |
I have a flac player working using:
AV.Player.fromURL
But, when I try to seek:
AV.Player.seek(0)
The console throws this error:
TypeError: Cannot read property 'offset' of undefined
Any ideas?
The text was updated successfully, but these errors were encountered: