Comments (21)
In the case of MP3 it might work. Normally we need the beginning of the file since container formats usually provide format info at the beginning. MP3 is weird in that it doesn't really have a container format, so the demuxer just looks for the first valid MP3 frame. Maybe your chunk sizes aren't big enough? If it doesn't find anything in the first chunk it receives, it won't look further.
Another option, is since you know it is MP3 just skip the demuxer all together and go straight to the decoder. This would require slightly more work on your part, but you could basically subclass the MP3Demuxer (MP3Demuxer.extend
) and override the probe class method to just return true, and remember to call AV.Demuxer.register(YourSubclass)
. Honestly I'm not sure what will happen, I've never tried streaming stuff, so let me know how it goes.
Try increasing your chunk size from (I assume) your custom source first, then try the custom demuxer idea...
from aurora.js.
I changed the MP3.js file while testing to just return true in the probe function (for now, instead of extending the class).
Now it tries to decode it but for every chunk it throws the AV.UnderflowError each time. It gets as far as this line
https://github.com/audiocogs/mp3.js/blob/master/src/header.js#L267 in MP3FrameHeader.decode before failing the Stream.prototype.available
function in aurora.
from aurora.js.
Yeah sounds like a chunk size issue maybe. Is it possible for you to increase it? What does your source look like?
from aurora.js.
Audio is coming from FFmpeg sending the audio through HTTP to a server that's relaying that audio over WebSocket to aurora. Have to experiment with FFmpeg options I think.
from aurora.js.
I'm working on this same issue:- using ffmpeg, data arrives into mp3.js, but not much else:-
Tried:-
ffmpeg -loglevel debug -re -i mind-explosion-1.mp4 -f mp3 -chunk_size 105k http://127.0.0.1:8081;
Tried with and without -re and changed chunk_size to various sizes, nada. Any advise welcomed.
from aurora.js.
Server is very simple setup:
var http = require('http');
var connect = require('connect');
var ws = require('ws');
// Consume the ffmpeg audio stream
var audio_consumer = http.createServer( function(req, res) {
console.log('Audio Stream Connected: ' + req.socket.remoteAddress);
req.on('data', function(data){
//When video data arrives, send to all the producer's clients
for (var i in audio_producer.clients){
audio_producer.clients[i].send(data, {binary:true});
};
});
req.on('end', function () {
res.end("Thanks");
});
req.on('error', function(e) {
console.log("ERROR ERROR: " + e.message);
});
}).listen(8081, "127.0.0.1");
var audio_producer = new ws.Server({port: 8071});
audio_producer.on('connection', function(socket) {
console.log('Audio Client Connected');
socket.on('close', function(code, message){
console.log( 'Disconnected Audio WebSocket ('+audio_producer.clients.length+' total)' );
});
});
console.log('Awaiting ws Audio Connections on http://127.0.0.1:8071/');
from aurora.js.
@asherawelan what does your client side code look like? I assume you implemented some sort of web socket source. I've actually never tried this with aurora, so I'm interested in getting this working.
from aurora.js.
Here it is :)
<html><head>
<meta charset="utf-8">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript" src="js/aurora.js"></script>
<script type="text/javascript" src="js/aurora-websocket.min.js"></script>
<script type="text/javascript" src="js/mp3.js"></script>
<script type="text/javascript">
//<![CDATA[
$(document).ready(function(){
AV.Player.fromWebSocket('ws://vixen.awelan.com:8071').play();
});
//]]>
</script>
</head>
<body>
<div id="container">
MP3 should stream here...
</body>
</html>
from aurora.js.
It seems no matter how many bytes are coming through it keeps failing the Stream.prototype.available
test. It's often by just 1 byte more.
from aurora.js.
I looked at that code you linked to in mp3.js above where you are seeing the error, and have a possible explanation. That code is looking for the next frame after the current one, which is apparently not loaded yet. Or perhaps because the next frame hasn't been encoded yet since it is streaming, looking for the next frame there is wrong. I'll play around a bit and see if I can figure something out.
from aurora.js.
You legend! I'm happy to tip you for your time...cheers!
Sent from my iPhone
On 28 Oct 2013, at 04:50, Devon Govett [email protected] wrote:
I looked at that code you linked to in mp3.js above where you are seeing the error, and have a possible explanation. That code is looking for the next frame after the current one, which is apparently not loaded yet. Or perhaps because the next frame hasn't been encoded yet since it is streaming, looking for the next frame there is wrong. I'll play around a bit and see if I can figure something out.
—
Reply to this email directly or view it on GitHub.
from aurora.js.
Any further news on this? Happy to tip the person who can fix it... cheers!
from aurora.js.
I would love to know if there is any progress! Streaming live feeds seems like THE reason to use these javascript codecs rather than simply using the browser html5 audio tags. Its the perfect used case except that it isn't working.
from aurora.js.
I never got it working for live streaming, such a shame...
from aurora.js.
Bump
from aurora.js.
Any further progress on this @devongovett - really keen to get this working... Cheers
from aurora.js.
i'm also interested. is at any solutions?
from aurora.js.
I think this is related to what's discussed here audiocogs/mp3.js#12
from aurora.js.
Anyone found a solution to this?
Thanks
from aurora.js.
I was wondering the same thing. Anyone found a working solution?
I'am able to receive audio packets at browser level, but I don't have any sound.
from aurora.js.
See this thread
from aurora.js.
Related Issues (20)
- How do I decode to raw, resample to 44,1khz and split stereo into dual mono buffers?
- "Something is wrong in HTTPSource.loop" while using AV.Asset.fromURL(remoteUrl)
- [Solved]switch backend from Speaker to PortAudio(naudiodon)
- Aurora not playing certain flac files with no error
- Live decoding on Android
- Node example HOT 1
- No default jsDelivr CDN file set
- Problems with 24-bit WAV files
- Questions about memory manage.
- Is decoding a specific part of a gargantuan file supported efficiently? HOT 3
- HTTP requests still sending to server even if HTTP error is returned
- Unit tests fail on master branch
- Chrome browser change for same site cookies
- gyp build fail HOT 1
- build for browser
- m4a demuxer fails when processing a file with co64 atom
- Window Not Defined
- decode fail
- How to install additional codecs? HOT 1
- Uncaught SyntaxError: Unexpected identifier 'key'
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 aurora.js.