Comments (3)
Aurora.js will automatically detect that it is alac for you if your audio data is in a supported container format (e.g. MP4, CAF, etc.).
from alac.js.
Thank for reply.
My data is not in a container, but come directly from an airplay sender. As i am trying to add alac support to airsonos. Is there a way to decode it?
Sent from my iPhone
On 23 Apr 2015, at 18:17, Devon Govett [email protected] wrote:
Aurora.js will automatically detect that it is alac for you if your audio data is in a supported container format (e.g. MP4, CAF, etc.).
—
Reply to this email directly or view it on GitHub.
from alac.js.
Ah, ok. There isn't an easy built-in way to work with raw audio outside a container, but you can write your own "demuxer" for it. Here's an example (untested):
var RawALACDemuxer = AV.Demuxer.extend(function() {
AV.Demuxer.register(this);
this.probe = function(stream) {
// if you have some way of detecting your alac stream, use it here.
// this assumes it is always ALAC.
return true;
};
this.prototype.readChunk = function() {
if (!this.emittedFormat) {
// I *think* airplay always uses 16-bit, 2 channel, 44.1kHz
// but I'm not sure.
this.emit('format', {
formatID: 'alac',
sampleRate: 44100,
channelsPerFrame: 2,
bitsPerChannel: 16
});
this.emittedFormat = true;
}
// TODO: figure out where to get the magic cookie from...
if (!this.emittedCookie) {
this.emit('cookie', DATA_HERE);
this.emittedCookie = true;
}
var buffer = this.stream.readSingleBuffer(this.stream.remainingBytes());
this.emit('data', buffer);
};
});
As mentioned in the comment, ALAC also has a "magic cookie", with some additional information needed by the decoder. This information would normally live in the container, but since you don't have a container, I'm not sure where it should be. My guess is that it would be sent when you initially connect to an airplay stream, but I'm not exactly sure where/how. You'll have to figure that out and emit an AV.Buffer
containing the cookie data.
From this Go implementation of airplay, it looks like the data is in the RTSP ANNOUNCE packet, and is then converted to an ALACSpecificConfig struct. Not sure how that fits into your backend.
from alac.js.
Related Issues (13)
- Status update HOT 1
- Actual working demo HOT 3
- Workers HOT 16
- At the end of a stream, tries to read past end of buffer HOT 3
- Visualization uses a lot of CPU HOT 6
- Encoder ? HOT 10
- Encoder ?
- Fix description of project to reflect that it is not an encoder HOT 1
- Streaming and node.js
- 5.1?
- any plans for 24bit alac support? HOT 2
- A demuxer for this container was not found.
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 alac.js.