Code Monkey home page Code Monkey logo

Comments (9)

chris-rudmin avatar chris-rudmin commented on August 22, 2024 2

@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!

from opus-recorder.

seabrus avatar seabrus commented on August 22, 2024

@chris-rudmin thanks for the prompt response. Yes, I know about the mp3 license problem. But it looks like the situation has been changing and even in the USA mp3 will be free soon. I'm from the EU and most of my potential users are from the Europe too.

That said, I'll take a look at the example you mentioned.
One more idea is to convert to OGG Vorbis. No support from Safari, but Google's browsers support it.

from opus-recorder.

seabrus avatar seabrus commented on August 22, 2024

AAC in a mp4 container (*.m4a) - it looks like this is the answer.
Sizes:

  • test.oga -- 313 kB (opus)
  • test.mp3 -- 387 kB
  • test.m4a -- 431 kB
  • test.wav -- 4600 kB (4.6 MB)

from opus-recorder.

chris-rudmin avatar chris-rudmin commented on August 22, 2024

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.

from opus-recorder.

seabrus avatar seabrus commented on August 22, 2024

Hi,

1). WAV.
My app typically works with records of about 10 - 25 MB in size (OGG format) - it is about 0.5 - 1 hour of recording. These are mono records (mainly speech). Your package copes with that recording absolutely great because it is the smallest size I could achieve.

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?
Such a version will be much more universal from the point of view of browsers coverage.

Have a nice day

from opus-recorder.

chris-rudmin avatar chris-rudmin commented on August 22, 2024

@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!

from opus-recorder.

seabrus avatar seabrus commented on August 22, 2024

@chris-rudmin I see "There is no happiness in life" :)

from opus-recorder.

chris-rudmin avatar chris-rudmin commented on August 22, 2024

@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.

from opus-recorder.

chris-rudmin avatar chris-rudmin commented on August 22, 2024

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.

from opus-recorder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.