Comments (17)
The page you linked says android 5+ supports opus in an mkv container. The library is
returning opus in an ogg container.
On Wed, 22 Jul 2015 at 11:15 Diego Mesa [email protected] wrote:
Hello, I'm testing the example on Chrome mobile Android 5.0, it records
ok, but I can't play the recorded file.According to this doc
http://developer.android.com/guide/appendix/media-formats.html .ogg files
can be played on android.Do you have any idea?
Thank you
—
Reply to this email directly or view it on GitHub
#28.
from opus-recorder.
To make playback work, you could decode the file using oggopusDecoder.js and playback the raw PCM.
from opus-recorder.
@chris-rudmin I've been trying to make this work using oggopusDecoder.js as you suggested, but with no success. Could you provide a small example how this could be achieved in combination with an <audio>
tag? That'd be absolutely fantastic.
from opus-recorder.
@alexthewilde To playback in an <audio>
tag, will be multi-part process:
- Decode the audio using the decoder
- Convert Float32 PCM to INT16 and put into WAV RIFF container
- Playback wav blobURI in audio tag.
I'll try to post some code samples later on when I get some time.
If you don't need the audio tag, it will be simpler to playback from audio buffers using the web audio API.
from opus-recorder.
@chris-rudmin I've been researching this issue a bit more and found hpr.dogphilosophy.net/test/. This test shows that .ogg
works natively on Android/mobile Chrome, i.e. without being in a mkv
container.
Please have a look at this demo: http://jsfiddle.net/pm84nsdh/3/
The second audio example has been created using your Opus Recorder and it unfortunately doesn't play back in mobile Chrome. As you can see both files are served from the same server and have proper perms etc.
Can you spot any difference in these two ogg files which causes the one to play but not the other?
from opus-recorder.
Yes, the difference is one file is Vorbis encoded the other is Opus encoded. Ogg is just the container.
https://wiki.xiph.org/OggOpus
http://www.vorbis.com/
http://www.pitivi.org/manual/codecscontainers.html
from opus-recorder.
@chris-rudmin thanks for clarifying!
from opus-recorder.
@alexthewilde Don't despair though, decoding the ogg is not hard. I'll try and post an example tonight.
from opus-recorder.
Made an example page to decode the file to wav audio. Hope this helps
https://github.com/chris-rudmin/DecodeToWav
http://rawgit.com/chris-rudmin/DecodeToWav/master/example.html
from opus-recorder.
@chris-rudmin that's super helpful, cheers! I guess I can make it work from there.
from opus-recorder.
@alexthewilde if you are reading the file from the server I think you can do it like this to get an arraybuffer:
var oReq = new XMLHttpRequest();
oReq.open("GET", "/myfile.ogg", true);
oReq.responseType = "arraybuffer";
...
from opus-recorder.
How may time can you record in android chrome? I record about 10s and the browser crash down!
from opus-recorder.
@diegomesata Never tried in mobile. I would assume you are limited by device resources (memory). If you are saving the file to the server in the end, you could try and stream the data as it is encoded instead of storing locally. To do this, you should override recorder.onPageEncoded()
from opus-recorder.
@diegomesata If you could leave me a stack trace, or whatever error you get, it might be helpful. Perhaps it is something we can fix.
from opus-recorder.
@chris-rudmin today browser doesn't crash down, sorry for the false alarm. At server side what library could I use to decode the ogg to wav?
Edit: My server side is c#. Could it be https://github.com/ioctlLR/NVorbis?
from opus-recorder.
@diegomesata Personally, I like sox. I think you can run command line stuff in c#. If so you also have the choice of opus-tools.
from opus-recorder.
Thank you for all your help, opus-tools converts the file to wav without problem, but with sox I got: sox.exe FAIL formats: no handler for detected file type `opus'
from opus-recorder.
Related Issues (20)
- How to use with Vite? HOT 5
- The first recording is not saved in Safari on IOS 15.1 HOT 1
- Robotic, torn audio on IOS 15.1 HOT 3
- Issue while using decoder with React application HOT 11
- Recorder output file size too small - Vue.js HOT 4
- building and running on windows 10 HOT 4
- Error running waveRecorder.html example HOT 3
- using waveform-playlist with opus-recorder HOT 1
- Uncaught TypeError: Cannot read properties of undefined (reading 'length')
- Not working with Vite + Vue 3
- wasm streaming compile failed: TypeError: Could not download wasm module falling back to ArrayBuffer instantiation how can i resolve this issue ? HOT 3
- Convert 16 bit signed int to 32 bit float HOT 8
- Audio distorted after 30 seconds HOT 6
- few seconds of recording are missing at the beginning (especially on IOS)
- Play pages real-time HOT 2
- ondataavailable not fired with waveWorker
- TypeScript definitions HOT 1
- Opus Player
- Is it possible to Decode two audio sources HOT 4
- Error webassembly.compile HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opus-recorder.