-
Notifications
You must be signed in to change notification settings - Fork 172
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
A way to play OGG Opus on mobile devices #58
Comments
@seabrus I started this project initially because I wanted a web audio that was free in the monetary sense. I'm not sure you are aware, but using mp3 encoders and decoders requires a usage license (which is not cheap BTW). If you take a look at the decoder example, you can see how to convert ogg/opus to a riff/wav format on the client which can be used in a normal audio tag. I never tried the decoder in a mobile browser so i can't say how fast it will be. Let me know what route you take and how it works out! |
@chris-rudmin thanks for the prompt response. Yes, I know about the That said, I'll take a look at the example you mentioned. |
AAC in a
|
Cool. A note about the file size, if you do client side decoding of opus, the data transferred will be that of the test.oga file but will consume 4.6MB of memory on the device. |
Hi, 1). WAV. But if I convert these files into WAV (even on the client only) it will be 12 times larger, i.e., about 120 - 250 MB. Taking into accout that a typical page in my app contains several records it may be quite problematic to use this approach on the mobile devices (that said, tests should be done to check that exactly). 2). That is why I try to find another way to solve the problem. The M4A/AAC format looks as a very promising solution. It is license free. It is quite compact. So my question is: Is it possible to develop a version of your package which will convert files to this fotmat (not to the OGG Opus) on the client? I mean that everything is the same like it is now but the package produces a M4A file/blob as a result? Have a nice day |
@seabrus Distributing AAC files doesn't require a license but writing a decoder/encoder would require a license: https://en.wikipedia.org/wiki/Advanced_Audio_Coding#Licensing_and_patents. You might be able to compile an open source codec to javascript. Good luck! |
@chris-rudmin I see "There is no happiness in life" :) |
@seabrus You might be able to create a ring buffer (Web Audio Node) that loops for playback and decode just the necessary chunks into raw PCM as required. This way you don't decode all at once and don't explode the page memory as well. |
If you setup your backend appropriately you could even serve the ogg file one page at a time allowing for very fast playback on the client. |
Hello Chris,
This is a question.
First of all, thank you very much for your package. It's really great and helpful, in particular, because it converts the output to the
OGG
format which is very compact. Also, your package is fast and reliable.I've analyzed some of the most popular packages for sound recording and found that yours is one of the best or even the best one. Now I'm developing an app that is based on your package. But recently I've understood that some of potential users of my app will visit it via mobile devices and mobile browsers.
According to this list
OGG Opus
is supported by mobile browsers very weak. So, I need to provide such users with audio files in some other format thanOGG Opus
.I've analyzed the issue #28. The approach described there is interesting but
wav
files are relatively large in comparision withOGG
files and require much more traffic. There could be another way to solve the problem, namely, to convertOGG
to themp3
format (which has great support on the mobile devices) on the server. Now I'm considering converting all recordedOGG
files intomp3
on the server using theffmpeg
library. As a result, I'll store onlymp3
files in the DB.But before to implement this approach I've decided to ask your opinion. What do you think about this way? Maybe, there are other approaches that are more efficient?
Thank you in advance.
By the way, I've considered a client-side converting
OGG
tomp3
but tests indicated that this process is very long and requires too much resources to be done. So I gave up that idea.The text was updated successfully, but these errors were encountered: