Skip to content
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

Streaming an MP3 - no errors, but no sound.... #50

Closed
asherawelan opened this issue Nov 8, 2013 · 1 comment
Closed

Streaming an MP3 - no errors, but no sound.... #50

asherawelan opened this issue Nov 8, 2013 · 1 comment

Comments

@asherawelan
Copy link

I am using the following code to process a ws stream.
The data I am sending works fine through a http stream in an audio tag - and through a conventional flash method method of playing streams.

I have included the console.log of data, if that helps... the byte length looks fairly big enough (byteLength: 4180), but I can increase if need be... I have tried some big numbers already!

The stream is an MP3 feed, which is realtime radio so dosn't have the MP3 headers AV may be expecting, I can inject these on connection if that's the right thig to do, just need to know what AV is expected.

var MySource = AV.EventEmitter.extend({
start: function() {
var source = this
source.socket = new WebSocket("ws://localhost:8071");
source.socket.binaryType = 'arraybuffer';

        source.socket.onmessage = function(data) {

                console.log(data);

            var abData = new AV.Buffer(data.data);
            source.emit('data', abData);

            //if (LAST_CHUNK) {
            //    source.emit('end');
            //}
        };
    },

    pause: function() {
        //this.socket.disconnect();
        //delete this.socket;
    },

    reset: function() {}
});

Console Output

MessageEvent {ports: Array[0], data: ArrayBuffer, source: null, lastEventId: "", origin: "ws://localhost:8071"…}
bubbles: false
cancelBubble: false
cancelable: false
clipboardData: undefined
currentTarget: WebSocket
data: ArrayBuffer
byteLength: 4180
proto: ArrayBuffer
defaultPrevented: false
eventPhase: 0
lastEventId: ""
origin: "ws://localhost:8071"
ports: Array[0]
returnValue: true
source: null
srcElement: WebSocket
target: WebSocket
timeStamp: 1383899351132
type: "message"
proto: MessageEvent

@devongovett
Copy link
Member

Closing due to inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants