Code Monkey home page Code Monkey logo

node-rtp's Introduction

node-rtp

node-rtp is an RTP module for node.js. It currently only supports sending audio only.

Requirements

  • Node.JS v0.1.103+

Example

See 'examples/sendg711.js' for how to send G.711 audio (you will need to provide the audio file -- the example works with a PCM mu-law encoded audio file). Currently, you will need to find a receiver program/device that plays incoming audio at least until receiving audio is implemented in node-rtp. FWIW, I am personally testing node-rtp with a Cisco IP phone (7961G with SIP firmware) over a LAN.

API

node-rtp currently exports one objects: RtpPacket.

RtpPacket

Constructor: new RtpPacket(payload)

Creates a new instance of an RTP packet.

payload is simply a Buffer containing up to 512 bytes of audio data.

Note: The size of the payload may need to be less than 512 bytes, depending on what encoding you are using.

type

Gets/Sets the RTP packet's payload type. This must be a valid value from the table given in section 6 of RFC3551.

seq

Gets/Sets the RTP packet's sequence number. This number must be incremented by 1 for each RTP packet in a continuous stream. This is useful for the receiver to detect if it has missed any packets in the stream.

time

Gets/Sets the RTP packet's timestamp. This number must be incremented by the number of samples contained in the payload (generally the length of the payload buffer) for each RTP packet in a continuous stream.

source

Gets/Sets the RTP packet's synchronization source identifier. This number must be a unique number that identifies the source of the outgoing audio.

payload

Gets/Sets the RTP packet's payload. This is a buffer object containing audio samples.

packet

Returns the fully assembled RTP packet as a buffer object for sending over the network.

node-rtp's People

Contributors

mscdex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-rtp's Issues

Absolutely LOVE the code, great job! Help with RFC-2250

This code is super readable, to the point, and encapsulated perfectly..

The whole implementation is just an object with getters and setters...

sender uses setters, receiver uses getters & the constructor --

so i literally just read the datagram from the socket and throw it to the constructor...

AWESOME..

But my question is, what changes would I need to make to support rfc-2250.

Which getters and setters would need to change to support 2250?

Thanks!!

example is not right

every 20 ms
intvl = setInterval(writeData, 20);
but if ((bytesRead = fs.readSync(fd, buf, 0, buf.length)) > 0) {
i think it all read 0 - 160 bytes

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.